Hi everyone,
So I am a newbie to scripting and I am just starting to get the hang of certain things. I am having a problem with one of my scripts however using the “else” statement. The problem is line 3. If the screen decal for this is ~=nil then there is not a problem and the rest of the code is fine. However, if the screen decal ==nil, I want the script to skip this part of the code and move onto the next decal and so on. I thought “else” would fix this but I guess not, if someone can help me address the error it would be a life saver. Sorry if I did wrong formating, this is my first post. When line 3 ==nill then the entire script breaks and it doesn't move onto the next decal. I don't understand why.
function onClick()
local final = game.workspace.FallenFolder
if final.Districtnumber21 ~= nil then
final[("11")].Decal.Transparency = 0
final.Districtnumber21.District.number.TextTransparency = 0
final.Districtnumber21.District.number.TextStrokeTransparency = 0
wait(.4)
final.Districtnumber21:Remove()
final[("11")]:Remove()
else -- If final.Districtnumber21 == nil then continue on with the code right? or am I wrong?
wait(.3)
--continue on with code

3 comments
Basically if the Districtnumber21 == nil then I want the script to skip lines 3-10 and move on to the rest of the decals and I want it to go on this way etc.
You are right.
But it isn't working?