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

What kind of error is this?

Asked by 8 years ago

First off I'd like to thank you all for all the help you guys give. I just learned about basic coding from a book I got and it is really starting to come to me that I love scripting.

Now onto my problem.

ding = game.Lighting.CheckIn.TextButton
ping = game.Workspace.Con

script.Parent.MouseButton1Click:connect(function (onClicked)
    if MouseButton1Click then
        print ('Is this working..?')
        ding = Color3.new = ("Lime green")
        ping.CanCollide = true
        wait (1)
        ping.Veolocity = Vector3.new(0,0,-1)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,-2)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,-3)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,-4)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,-5)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,-4)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,-3)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,-3)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,-2)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,-1)
        wait(0.8)
        ping.Velocity = Vector3.new(0,0,0)
        ping.CanCollide = false
        wait(3)
        ding = TextButtonColor.new("Really red")
    end


Basically, this line:

    ding = Color3.new = ("Lime green")

is getting an error:

16:40:34.833 - Workspace.Script:5: 'then' expected near '='

I've searched Wiki but nothing. Any help?

1 answer

Log in to vote
1
Answered by 8 years ago

The problem here is you are trying to check a BoolValue using if, but what you are checking is an event.

Allow me to explain further.

If only works in the event that what your variables are hold value. MouseButton1Click holds no value. It is an event, meaning it is connected using the connect function.

So just delete line 5 and it's corresponding 'end.'

0
You've been helping me all day Urban, thank you! Thanks! VirtualFlying 55 — 8y
0
Ok just tried this in studio, and it says this is an error: "ding = Color3.new = ("Lime green")" and the error says this: "17:33:40.945 - Players.Player.PlayerGui.CheckIn.TextButton.Script:6: unexpected symbol near '='" VirtualFlying 55 — 8y
0
ding = Color3.new("Lime green") AmericanStripes 610 — 8y
Ad

Answer this question