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

Why doesn't this decal script work? [STILL UNANSWERED]

Asked by 10 years ago

Hi, my script is highlighting line 5. I know why but I don't know how to fix it. I just had a holiday for a week so it has removed all of my knowledge of scripting. Please help me fix this simple error.

I think else has to do something with the 'if' statement. I just can't remember though -_-

Best regards, Nathan.

Fanfive=game.Workspace.Fans.Five.Decal

function onClick()
    Fanfive.Texture = 'http://www.roblox.com/asset/?id=166126631'
else
    Fanfive.Texture = 'http://www.roblox.com/asset/?id=166126649'
end

script.Parent.ClickDetector.MouseClick:connect(onClick)

2 answers

Log in to vote
0
Answered by 10 years ago

Where you have the else I think it should be 'else if'

You were probably right about the 'if' statement

Hope this helps.

^Ignore above^

I think it should be like this


Fanfive=game.Workspace.Fans.Five.Decal function onClick() Fanfive.Texture = 'http://www.roblox.com/asset/?id=166126631' else) Fanfive.Texture = 'http://www.roblox.com/asset/?id=166126649' end script.Parent.ClickDetector.MouseClick:connect(onClick)
0
Diddn't work, thanks anyway WelpNathan 307 — 10y
0
I realised, I looked at it and it says something about Line 7 Expecting to end Line 5... DerpyShadowz 34 — 10y
0
Hmm, WelpNathan 307 — 10y
0
Notice the else has a ) after it DerpyShadowz 34 — 10y
View all comments (3 more)
0
Nope :( WelpNathan 307 — 10y
0
I meant Line 5 Expecting to end Line 7 on the 2nd Comment DerpyShadowz 34 — 10y
0
Hmm.. Idk Explain to me what you are trying to do with the decal DerpyShadowz 34 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

whys there a else when there is no if?

0
and how does 1 week remove all scripting knowledge? I had a 6 week with no internet and still remember :P NinjoOnline 1146 — 10y
0
Shocking memory. Lol. xD WelpNathan 307 — 10y

Answer this question