So I’ve done a script where someone touches a part it turns on music and such.
But after a certain amount of time I want it to completely stop and to do the same thing it has to be re-activated by being touched (Basically just want it to stop after the function has went once)
I’ve tried adding a while true do loop inside the function but it kept doing the same thing, then I thought it must have something to do with values but I’m pretty inexperienced in scripting so I didn’t know if that’ll work or not.
I really would you ask to first learning Lua before start scripting it. This would really help you further if you understand what I mean. You even could learn things that you never learned before.
(A while-true-loop never ends, this is what caused your error. In this case you even could remove the for-loop and the while-loop, you don‘t need it I think. If you need that this repeats x times, then use a for-loop yes. You can learn more about loops here: