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
10 years ago
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

2 answers

Log in to vote
0
Answered by 10 years ago
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

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 — 10y
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 — 10y
0
You con't need "..V.." put simply V. ultrabug 306 — 10y
0
Listen to ultra for that one and then just put the Script inside the Text Label RolandStudio 115 — 10y
Ad
Log in to vote
0
Answered by
Rurith 10
10 years ago
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.

Answer this question