Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Thanks! Answered! Why is this GUI button not totally working?

Asked by
Dr_Doge 100
10 years ago

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?

01function MouseClick()
02    wait(0)
03    local numplaying = Game.Workspace.Game1.Players.Value;
04    if numplaying == 0 or numplaying == 1 then
05 
06 
07script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(19.6, 4.6, -27.6)
08wait(0)
09numplaying = (numplaying+1)
10 
11 
12 
13end
14end
15 
View all 27 lines...
0
By your title "not totally" I'm guessing part of it works, please say what works and what doesn't. Vividex 162 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

try this:- Also have you got filtering enabled?

01function MouseClick()
02    wait(0)
03    local numplaying = Game.Workspace.Game1.Players.Value
04    if numplaying == 0 or numplaying == 1 then
05 
06 
07script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(19.6, 4.6, -27.6)
08wait(0)
09numplaying = (numplaying+1)
10 
11end
12 
13local Health = script.Parent.Parent.Parent.Parent.Character.Humanoid.Health
14 
15if Health <=30 then
View all 22 lines...
0
try this Game.Workspace.Game1.Players.Value.Value -- fi you did not remame the propety User#5423 17 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

This should work...

01function MouseClick(player)
02    local numplaying = Game.Workspace.Game1.Players.Value;
03  if numplaying == 0 or numplaying == 1 then
04player.Torso.CFrame = CFrame.new(19.6, 4.6, -27.6)
05numplaying = (numplaying+1)
06end
07local Health =player.Humanoid.Health
08if Health <=30 then
09player.Humanoid.Health= "100"
10player.Torso.CFrame = CFrame.new(99.23, 149.962, -2.248)
11end
12end
13script.Parent.MouseButton1Down:connect(MouseClick)
0
change the numbers to please yourself rollercoaster57 65 — 10y

Answer this question