Advertisement
Anukun_Lucifer

TouchScript(Local)

Aug 13th, 2024
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.02 KB | Gaming | 0 0
  1. local TargetPart = workspace:WaitForChild("TargetPart") -- สร้างตัวแปร TargetPart โดยรอให้วัตถุที่ชื่อ "TargetPart" ใน workspace พร้อมใช้งาน
  2. local Replicated = game:GetService("ReplicatedStorage") -- เรียกใช้บริการ ReplicatedStorage
  3. local Remote = Replicated:WaitForChild("RemoteEvent") -- สร้างตัวแปร Remote โดยรอให้ RemoteEvent ใน ReplicatedStorage พร้อมใช้งาน
  4. local Players = game:GetService("Players") -- เรียกใช้บริการ Players
  5.  
  6. Remote.OnClientEvent:Connect(function() -- สร้างฟังก์ชันเมื่อได้รับ OnClientEvent จาก Remote
  7.     local Player = Players.LocalPlayer -- สร้างตัวแปร Player อ้างถึงผู้เล่นที่เป็น LocalPlayer
  8.     local Character = Player.Character -- สร้างตัวแปร Character อ้างถึงตัวละครของผู้เล่น
  9.     local Humanoid = Character:FindFirstChild("Humanoid") -- สร้างตัวแปร Humanoid เพื่ออ้างถึง Humanoid ในตัวละคร
  10.  
  11.     Humanoid.WalkSpeed = 100 -- ปรับความเร็วในการเดินของ Humanoid เป็น 100
  12.     Humanoid.JumpPower = 300 -- ปรับความสามารถในการกระโดดของ Humanoid เป็น 300
  13.  
  14.     TargetPart.Size = Vector3.new(40, 40, 40) -- ปรับขนาดของ TargetPart เป็น 40x40x40
  15.     TargetPart.Color = Color3.new(1, 0, 0.0980392) -- ปรับสีของ TargetPart เป็นสีเหลือง
  16.     TargetPart.CanCollide = true -- ปรับให้ TargetPart ไม่สามารถชนกับวัตถุอื่นได้
  17.     TargetPart.Transparency = 0.3 -- ปรับความโปร่งใสของ TargetPart เป็น 0.3
  18. end)
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement