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

Why is this decal script not working???

Asked by 10 years ago
decal = game.Workspace.DecalPicture.Decal

decalID = game.Workspace.DecalPicture.Decal.Texture

decal.decalID = "http://www.roblox.com/Decal-item?id=136313358"

if decal.decalID == false then
    print("There is something wrong with the decal")
end

It says Line 1 is wrong. It's suppose to be like a decal script. It's suppose to show the ID. but, it doesn't. Why?

P.S (decal is named, which is line 1)

1 answer

Log in to vote
3
Answered by 10 years ago

In line two, you already set 'decal' as a variable, so you can shorten it.

decal = Workspace.DecalPicture.Decal --Shortened.

decalID = decal.Texture --decal is already defined.

decalID = "http://www.roblox.com/asset/?id=136313358"

if decal.decalID == false then --Everything here on was correct.
    print("There is something wrong with the decal")
end

Line 3: Lua would've read it as "game.Workspace.DecalPicture.Decal.game.Workspace.DecalPicture.Decal.Texture" since you placed two variables that are basically the same.

If you have any other questions, feel free to inbox me.

~Kyo-chan

0
Ohh! I get it! Thanks so much!! Roboy5857 20 — 10y
Ad

Answer this question