Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can you help me with this?

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

2 comments

0

What is script.Parent.Parent.Control? An IntValue? A StringValue?

0

it is a Nunber Value

1 answer

✓ Accepted answer
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"

This discussion is preserved as it was. New answers, comments, and votes are closed.