I've got this script which gives me a point and teleports me. This script works in studio but not online. When I test it online it just gives me points not teleport. So how would i fix this? Also its not a localscript.
debounce = false
win = 1
money = 15
function onTouched(part)
if debounce == false then
debounce = true
local humanoid = part.Parent:findFirstChild("Humanoid")
if (humanoid~=nil) then
local thisplr = game.Players:findFirstChild(humanoid.Parent.Name)
if (thisplr~=nil) then
local stats = thisplr:findFirstChild("leaderstats")
if (stats~=nil) then
local score = stats:findFirstChild("Wins")
local score2 = stats:findFirstChild("Money")
if (score~=nil) then
score.Value = score.Value + win
if (score2~=nil) then
score2.Value = score2.Value + money
local character = game.Players.LocalPlayer.Name
local torso = part.Parent:findFirstChild("Torso")
torso.CFrame = game.Workspace.SpawnLocation.CFrame + Vector3.new(0,10,0)
wait(0.6)
debounce = false
end
end
end
end
end
elseif debounce == true then
print("no")
debounce = false
end
end
script.Parent.Touched:connect(onTouched)

1 comment
Thank you for the reply, you took your time and effort into. But i just removed line 19 just like you did a while back. I willl upvote you.