You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I am trying to teleport the player 5 studs in front of them every time the remote event is activated -
What is the issue? Include screenshots / videos if possible!
Local variables in function not changing(?) It only teleports the player slightly off the first teleport after the first activation
robloxapp-20240806-1939242.wmv (1005.0 KB)
here is the script
-- local remoteEvent = game.ReplicatedStorage.RemoteEvent
remoteEvent.OnServerEvent:Connect(function()
local HumanoidRootPart = Tool.Parent.HumanoidRootPart
local Direction = HumanoidRootPart.Parent.Head.CFrame.LookVector
local Distance = 5
local Target = HumanoidRootPart.Parent.Head.CFrame.Position + (Direction * Distance)
print(Target)
local AnimTrack = Tool.Parent:WaitForChild("Humanoid"):LoadAnimation(anim[1])
HumanoidRootPart.Position = Target
end)
i just come back to scripting after a long time and im stumped