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?
01 | function MouseClick() |
02 | wait( 0 ) |
03 | local numplaying = Game.Workspace.Game 1. Players.Value; |
04 | if numplaying = = 0 or numplaying = = 1 then |
05 |
06 |
07 | script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new( 19.6 , 4.6 , - 27.6 ) |
08 | wait( 0 ) |
09 | numplaying = (numplaying+ 1 ) |
10 |
11 |
12 |
13 | end |
14 | end |
15 |
try this:- Also have you got filtering enabled?
01 | function MouseClick() |
02 | wait( 0 ) |
03 | local numplaying = Game.Workspace.Game 1. Players.Value |
04 | if numplaying = = 0 or numplaying = = 1 then |
05 |
06 |
07 | script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new( 19.6 , 4.6 , - 27.6 ) |
08 | wait( 0 ) |
09 | numplaying = (numplaying+ 1 ) |
10 |
11 | end |
12 |
13 | local Health = script.Parent.Parent.Parent.Parent.Character.Humanoid.Health |
14 |
15 | if Health < = 30 then |
This should work...
01 | function MouseClick(player) |
02 | local numplaying = Game.Workspace.Game 1. Players.Value; |
03 | if numplaying = = 0 or numplaying = = 1 then |
04 | player.Torso.CFrame = CFrame.new( 19.6 , 4.6 , - 27.6 ) |
05 | numplaying = (numplaying+ 1 ) |
06 | end |
07 | local Health = player.Humanoid.Health |
08 | if Health < = 30 then |
09 | player.Humanoid.Health = "100" |
10 | player.Torso.CFrame = CFrame.new( 99.23 , 149.962 , - 2.248 ) |
11 | end |
12 | end |
13 | script.Parent.MouseButton 1 Down:connect(MouseClick) |