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

How to make a texture changing block?

Asked by 9 years ago

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

Log in to vote
1
Answered by
Validark 1580 Snack Break Moderation Voter
9 years ago

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.

0
Thx for the help! i really appreciate it. fattyfateric1 0 — 9y
Ad
Log in to vote
0
Answered by 9 years ago
block.ClickDetector.MouseClick:connect(function()
while true do 
 if texture id==100000 then
texture id...........
 end
end
end)

Answer this question