I am making a game and there are CLICK to teleport scripts in it. When they are in their vehicles if they click the teleporter the car teleports with them.
Is there a way to configure this script so that while they're sitting they do not teleport?
~~~~~~~~~~~~~~~~~
function onClicked()
local c = game.Players:GetChildren() for i = 1, #c do c[i].Character.Torso.CFrame = CFrame.new(script.Parent.Parent.Teleport.Position) end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
If you don't want players teleporting when they're sitting, you can simply use a conditional statement and the Sit property in the humanoid to do this.
for i,v in pairs(game.Players:GetPlayers()) do if v.Character.Humanoid.Sit == false then --Code here end end