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

Decal script not working when script.parent is stated?

This script only works when I put -

local d = game.workspace.poster.decal

but the problem is, I want to put this poster inside of a model, and duplicate that model multiple times. It won't work. Just so you know, the part that is affecting it is

local d = script.Parent.Parent.Parent.Parent.Decal

Frame = script.Parent
Frame.GenerateButton.MouseButton1Click:connect(function()
local d = script.Parent.Parent.Parent.Parent.Decal
d.Texture = "http://www.roblox.com/asset/?id="..tonumber(script.Parent.TextureId.Text)-1
end)


1 answer

Roblox recently had an update when you don't have to substract the ID of a decal. Try this:

Frame = script.Parent
Frame.GenerateButton.MouseButton1Click:connect(function()
local d = script.Parent.Parent.Parent.Parent.Decal
d.Texture = "http://www.roblox.com/asset/?id="..script.Parent.Text
end)

5 comments

0

didnt work

0

Updated

0

still doesnt work

0

I never heard of any update that said they fixed it. Also sometimes you have to subtract the number by 2 or 3 for the decal to work instead of 1.

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