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

SurfaceGUI and Math help?

Asked by
Rurith 10
11 years ago
01V=0
02function Touched(Plr)
03if game.Players[Plr.Parent.Name]~=nil then
04V=V+1
05end
06 
07function Ended(Plr)
08if game.Players[Plr.Parent.Name]~=nil then
09V=V-1
10end
11 
12script.Parent.Touched:connect(Touched)
13script.Parent.TouchEnded:connect(Ended)

How do I make it so when it +1 it also adds +1 on a SurfaceGUI text

2 answers

Log in to vote
0
Answered by 11 years ago
01V=0
02function Touched(Plr)
03if game.Players[Plr.Parent.Name]~=nil then
04V=V+1
05end
06 
07function Ended(Plr)
08if game.Players[Plr.Parent.Name]~=nil then
09V=V-1
10end
11 
12script.Parent.Touched:connect(Touched)
13script.Parent.TouchEnded:connect(Ended)
14 
15local var = 0
16repeat
17wait(0.1)
18script.Parent.Text = ..V.. --In this case the Script is in a Textbox which is in a SurfaceGUI which is in a part
19until var==10

I think it might work

0
If it doesn't work then at the "..V.." try editing the dots to "..V" or "V.." or "..V. " else give me the error the output says and ill try to fix it RolandStudio 115 — 11y
0
Dude, Im kinda confused, this is how I have it set up: http://gyazo.com/8f0529876a096ef039221d6a973fd46a (Script is where I have your script in) Rurith 10 — 11y
0
You con't need "..V.." put simply V. ultrabug 306 — 11y
0
Listen to ultra for that one and then just put the Script inside the Text Label RolandStudio 115 — 11y
Ad
Log in to vote
0
Answered by
Rurith 10
11 years ago
01V=0
02function Touched(Plr)
03if game.Players[Plr.Parent.Name]~=nil then
04V=V+1
05end
06 
07function Ended(Plr)
08if game.Players[Plr.Parent.Name]~=nil then
09V=V-1
10end
11 
12script.Parent.Touched:connect(Touched)
13script.Parent.TouchEnded:connect(Ended)
14 
15local var = 0
View all 21 lines...

I added 2 ends at the bottom and there no prob or bad output, ect.

Answer this question