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

Can you help me with this?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
while true do
wait(0.05)

while true do
if script.Parent.Parent.Control.Value == 0.03 then
while true do
script.Parent.a.SurfaceGui.TextLabel.Text = "This train Terminus here."
script.Parent.b.SurfaceGui.TextLabel.Text = "You can exit this train"
wait(5)
script.Parent.a.SurfaceGui.TextLabel.Text = "or stay here"
script.Parent.b.SurfaceGui.TextLabel.Text = ""
wait(5)

if script.Parent.Parent.Control.Value == 0.05 then
script.Parent.a.SurfaceGui.TextLabel.Text = "Ad.test"
script.Parent.b.SurfaceGui.TextLabel.Text = "Ad.test"


end
end
end

l want to change the Value from 0.03 to 0.05,it success but the script keep in Value 0.03 steps

l need a scripts to fix it

Note :the Studio not say anythings

0
What is script.Parent.Parent.Control? An IntValue? A StringValue? Merely 2122 — 9y
0
it is a Nunber Value 7785543 2 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago
while wait(0.5) do -- waits 0.5 seconds before re looping
if script.Parent.Parent.Control.Value == 0.03 then
script.Parent.a.Surface Gui.TextLabel.Text = "This train Terminus here."
script.Parent.b.SurfaceGui.TextLabel.Text = "You can exit this train"
wait(5)
script.Parent.a.SurfaceGui.TextLabel.Text = "or stay here"
script.Parent.b.SurfaceGui.TextLabel.Text = ""
wait(5)
script.Parent.Parent.Control.Value = 0.05 -- set controls values
elseif script.Parent.Parent.Control.Value == 0.05 then
script.Parent.a.SurfaceGui.TextLabel.Text = "Ad.test"
script.Parent.b.SurfaceGui.TextLabel.Text = "Ad.test"
wait(5)
script.Parent.Parent.Control.Value = 0.03 -- set controls value
end

One you didn't need all those while true do Other thing was you put ifs try using elseif Also it might be easier for you to use variables instead of writing it out each time. Ex.

a = script.Parent.a.SurfaceGui.TextLabel
a.Text = "hi"
Ad

Answer this question