V=0 function Touched(Plr) if game.Players[Plr.Parent.Name]~=nil then V=V+1 end function Ended(Plr) if game.Players[Plr.Parent.Name]~=nil then V=V-1 end script.Parent.Touched:connect(Touched) script.Parent.TouchEnded:connect(Ended)
How do I make it so when it +1 it also adds +1 on a SurfaceGUI text
V=0 function Touched(Plr) if game.Players[Plr.Parent.Name]~=nil then V=V+1 end function Ended(Plr) if game.Players[Plr.Parent.Name]~=nil then V=V-1 end script.Parent.Touched:connect(Touched) script.Parent.TouchEnded:connect(Ended) local var = 0 repeat wait(0.1) script.Parent.Text = ..V.. --In this case the Script is in a Textbox which is in a SurfaceGUI which is in a part until var==10
I think it might work
V=0 function Touched(Plr) if game.Players[Plr.Parent.Name]~=nil then V=V+1 end function Ended(Plr) if game.Players[Plr.Parent.Name]~=nil then V=V-1 end script.Parent.Touched:connect(Touched) script.Parent.TouchEnded:connect(Ended) local var = 0 repeat wait(0.1) script.Parent.Text = V until var==10 end end
I added 2 ends at the bottom and there no prob or bad output, ect.