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

Cen you help me ?

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)

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
end

*This script not is full staple Wrong:The script do no to anything! Value:Number Value l need a fixed script

0
what does "a" and "b" equal ?? NinjoOnline 1146 — 9y
0
'a' and 'b' are not varialbes in this case, they are members of 'script.Parent'. adark 5487 — 9y
0
Using my code, what output errors are you getting? adark 5487 — 9y

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

It looks to me that your ends are not placed properly. Also, using the while true do loop on the inside of the if statement is incorrect. To avoid the problem I think you're trying to avoid, try using elseif statements in place of every if statement after the first. Also, try tabbing the code, so you can see the logic more clearly:

local a = script.Parent.a.SurfaceGui.TextLabel
local b = script.Parent.b.SurfaceGui.TextLabel
local Control = script.Parent.Parent.Control
while true do
    wait(.05)

    if Control.Value == 0.03 then
        a.Text = "This train Terminus here." --"terminates" is the word you're looking for here.
        b.Text = "You can exit this train"
        wait(5)
        a.Text = "or stay here"
        b.Text = ""
        wait(5)
    --Note that there is no `end` here. The `elseif` does not get an end, only the `if`, but `elseif`s must be places within `if` statements.
    elseif Control.Value == 0.05 then
        script.Parent.a.SurfaceGui.TextLabel.Text = "Ad.test"
        script.Parent.b.SurfaceGui.TextLabel.Text = "Ad.test"
    end
end
0
Bad,Keep get wrong 7785543 2 — 9y
Ad

Answer this question