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

Why doesn't my texture-changing script work ?

Hello,there !

I'm trying to make a script where you click onto a button on a ScreenGui and then your mesh's texture changes by the selected color, but it doesn't work...

Here's my attempt:

Car = script.Parent Red = game.StarterGui.ChevPaint.ImageLabel.ScrollingFrame.Red.TextButton

Red.MouseButton1Click:connect(function() Car.TextureID = '1005158804'

end)

I'm not sure if I did it correct,I didn't get any red or blue lines underneath the codes. Could any of you find the problem because I'm not sure of it... Do I write full address of the ID like 'http://www.roblox.com/develop/decals/[Code Here]/Red' or just '[Code Here]'

2 comments

0

please format your code

0

like 'rbxassetid://1005158804' already tried...

1 answer

✓ Accepted answer

To change the texture id you need to add rbxassetid://. For example:

script.Parent.Decal.Texture = "rbxassetid://1234567890"
script.Parent.ImageLabel.Image = "rbxassetid://1234567890"

Please accept my answer if this helped!

1 comment

0

Sorry,already tried with the rbxassetid:// way, but no changes, but I assume it must be correct as you didn't write any corrections rather than rbx thing

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