Before I start with this I want to let the reader know I am a very beginner scripter.
So basically I created a text button with a localScript inside and the local script creates a part, and adds a mesh to it. Everything works fine the first time but the second time the output says “Attempting to call a nil value” and does not spawn the part + mesh. Any ideas?
Scripts + Output:
For the last pic I clicked twice, the first time it worked the second time it didn’t.
Why is your function inside something that requires the function because that function only exists in that if statement and that if statement cant see inside itself and the 16th line cant see inside that if statement
Im also a beginner scripter but i have done a few things in studio and i learned a month ago
I’m pretty sure it is because system does not read the function until the textbutton is clicked. it reads the entire script before starting the function