Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TargetPart = workspace:WaitForChild("TargetPart") -- สร้างตัวแปร TargetPart โดยรอให้วัตถุที่ชื่อ "TargetPart" ใน workspace พร้อมใช้งาน
- local Replicated = game:GetService("ReplicatedStorage") -- เรียกใช้บริการ ReplicatedStorage
- local Remote = Replicated:WaitForChild("RemoteEvent") -- สร้างตัวแปร Remote โดยรอให้ RemoteEvent ใน ReplicatedStorage พร้อมใช้งาน
- local Players = game:GetService("Players") -- เรียกใช้บริการ Players
- Remote.OnClientEvent:Connect(function() -- สร้างฟังก์ชันเมื่อได้รับ OnClientEvent จาก Remote
- local Player = Players.LocalPlayer -- สร้างตัวแปร Player อ้างถึงผู้เล่นที่เป็น LocalPlayer
- local Character = Player.Character -- สร้างตัวแปร Character อ้างถึงตัวละครของผู้เล่น
- local Humanoid = Character:FindFirstChild("Humanoid") -- สร้างตัวแปร Humanoid เพื่ออ้างถึง Humanoid ในตัวละคร
- Humanoid.WalkSpeed = 100 -- ปรับความเร็วในการเดินของ Humanoid เป็น 100
- Humanoid.JumpPower = 300 -- ปรับความสามารถในการกระโดดของ Humanoid เป็น 300
- TargetPart.Size = Vector3.new(40, 40, 40) -- ปรับขนาดของ TargetPart เป็น 40x40x40
- TargetPart.Color = Color3.new(1, 0, 0.0980392) -- ปรับสีของ TargetPart เป็นสีเหลือง
- TargetPart.CanCollide = true -- ปรับให้ TargetPart ไม่สามารถชนกับวัตถุอื่นได้
- TargetPart.Transparency = 0.3 -- ปรับความโปร่งใสของ TargetPart เป็น 0.3
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement