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

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

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

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)

7 comments

0

Diddn't work, thanks anyway

0

I realised, I looked at it and it says something about Line 7 Expecting to end Line 5...

0

Hmm,

0

Notice the else has a ) after it

0

Nope :(

0

I meant Line 5 Expecting to end Line 7 on the 2nd Comment

0

Hmm.. Idk Explain to me what you are trying to do with the decal

whys there a else when there is no if?

2 comments

0

and how does 1 week remove all scripting knowledge? I had a 6 week with no internet and still remember :P

0

Shocking memory. Lol. xD

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