Hello guys, I’ve tried a script that has not worked.
It only shows the animation to the server:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
script.Parent.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
local animation = script.Parent.Parent.Scoot
local animator = hum.Animator
animator:LoadAnimation(animation):Play()
character.HumanoidRootPart.CFrame = script.Parent.Parent:WaitForChild("Teleport").CFrame
character.Humanoid.WalkSpeed = 0
character.Humanoid.UseJumpPower = true
character.Humanoid.JumpPower = 0
end
end)
end)
end)
Even if I try convert it to a local script, it won’t actually work.
I’ve heard of RemoteEvents but I’m not sure how to use them in this situation.
Here’s the local script I’ve tried:
local character = game.Players.LocalPlayer.Character
script.Parent.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
local animation = script.Parent.Parent.Scoot
local animator = hum.Animator
animator:LoadAnimation(animation):Play()
character.HumanoidRootPart.CFrame = script.Parent.Parent:WaitForChild("Teleport").CFrame
character.Humanoid.WalkSpeed = 0
character.Humanoid.UseJumpPower = true
character.Humanoid.JumpPower = 0
end
end)
Sorry if my grammar is trash, I literally just woke up and also sorry if this is a stupid question, again, I just woke up.