I have a script which i can only get to work in a local script (which is ok) in the starter pack(which makes it global) but i want the script its self to be in a block with a range on it.
function teleport() local char = game:GetService("Players").LocalPlayer.Character char.HumanoidRootPart.CFrame = CFrame.new(-185.8, 357.3, -569.6) end game:GetService("ContextActionService"):BindAction( "Teleport", teleport, false, Enum.KeyCode.E )
dose any one know anything i need to add or change on this script
THX :D
Aye, you used the code I helped you with.
To get the range, find the magnitude of the part:
local dist = (char.HumanoidRootPart.Position - part.Position).magnitude if dist <= 20 then -- make 20 bigger if you want more range, smaller for less. --do your code end