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

How to make a texture changing block?

I want a block that when you click it a series of textures shows up on the block, and the block disappears. Help me? something like

block. Mousebutton1click
texture id=100000 then
texture id.....
--and so on

2 answers

✓ Accepted answer

If you want to be able to click the block, you are going to have to put what is called a ClickDetector in it. You can insert it by right clicking it in the Explorer panel and clicking ClickDetector.

To make the texture change, I would do something like this

function onClicked()  --Function called onClicked

script.Parent.NameOfDecalOrTextureElement.Texture=100000 --enter in your textures
wait(1)
script.Parent.NameOfDecalOrTextureElement.Texture=100001 --enter in your textures
wait(1)
script.Parent.NameOfDecalOrTextureElement.Texture=100002 --enter in your textures
end
script.Parent.ClickDetector.MouseClick:connect(onClicked) --when the ClickDetector recieves a click it will run the function called "onClicked"

That is the basic way to do it. You can make a table if you like. Contact me @Validark on Roblox if you have any more troubles.

1 comment

0

Thx for the help! i really appreciate it.

block.ClickDetector.MouseClick:connect(function()
while true do 
 if texture id==100000 then
texture id...........
 end
end
end)

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