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

Why is Line 3 wrong?

Asked by 10 years ago

So I have a script. IN the output it says 19:37:53.163 - Workspace.Script:3: 'then' expected near '='. And I figured Line 3 is wrong.

Torso = game.Workspace.Roboy5857.Torso

if Torso.Transparency=0.1 then 
    Torso.Tramsparency=0.1
    wait(0.05)
    Torso.Tramsparency=0.2
    wait(0.05)
    Torso.Tramsparency=0.3
    wait(0.05)
    Torso.Tramsparency=0.5
    wait(0.05)
    Torso.Tramsparency=0.6
    wait(0.05)
    Torso.Tramsparency=0.7
    wait(0.05)
    Torso.Tramsparency=0.8
    wait(0.05)
    Torso.Tramsparency=0.9
    wait(0.05)
    Torso.Tramsparency=1
    wait(0.05)
else
    if Torso.Transparnecy=0 then
        Torso.Transparency=0
    end
end

Why?

3 answers

Log in to vote
1
Answered by
c0des 207 Moderation Voter
10 years ago

Most of the time you meant to put "Transparency", you put "Tramsparency".

Ad
Log in to vote
1
Answered by 10 years ago

Because = is used when you want to set a variable, but for logic statements you use ==. Also, you should use loops instead of writings tons of similar commands:

Torso = game.Workspace.Roboy5857.Torso

if Torso.Transparency == 0.1 then 
    for num=1,10 do
        Torso.Transparency = Torso.Transparency + 0.1
        wait(0.05)
    end
else
    if Torso.Transparnecy = 0 then
        Torso.Transparency = 0
    end
end


Log in to vote
0
Answered by 10 years ago

You spelled Transparency wrong from lines 4-20.

Answer this question