The button teleports, but dose not change the numplaying value! Also the script wont teleport the player back to spawn with full health when he/she has 30 or lower health!
Dose someone have a fix?
function MouseClick()
wait(0)
local numplaying = Game.Workspace.Game1.Players.Value;
if numplaying == 0 or numplaying == 1 then
script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(19.6, 4.6, -27.6)
wait(0)
numplaying = (numplaying+1)
end
end
script.Parent.MouseButton1Down:connect(MouseClick)
local Health = script.Parent.Parent.Parent.Parent.Character.Humanoid.Health
if Health <=30 then
script.Parent.Parent.Parent.Parent.Character.Humanoid.Health= "100"
script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(99.23, 149.962, -2.248)
end

1 comment
By your title "not totally" I'm guessing part of it works, please say what works and what doesn't.