I wrote this script but it deosn’t work
while true do
script.Parent.TextureId = "rbxassetid://13078612043"
wait(.2)
script.Parent.TextureId = "rbxassetid://13078696118"
end
I wrote this script but it deosn’t work
while true do
script.Parent.TextureId = "rbxassetid://13078612043"
wait(.2)
script.Parent.TextureId = "rbxassetid://13078696118"
end
Hi, here to help!
Nope, there are no errors and the parent is in fact a mesh.
Since I don’t know the expected behavior here’s my assumption. I assume that by making a while loop, you’re trying to switch back and forth between these textures every 0.2 seconds. But only one texture is ever set because you need two wait(0.2) calls in your script, one after both of the texture changes. That’s because, by only having one wait(), you’re letting one texture set, then the script waits .2 seconds, sets the second texture and then immediately goes back to the first one (according to the while loop). Try something like this:
while true do
script.Parent.TextureId = "rbxassetid://13078612043"
wait(.2)
script.Parent.TextureId = "rbxassetid://13078696118"
wait(.2)
end
Roblox saves the mesh’s data on the user’s device and to avoid a developer completely destroying the user’s device - by continuously changing the mesh -, they don’t give us the ability to edit a mesh’s texture from scripts.
They may have added support for this without me noticing but that is the answer most probably.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.