✓ Accepted answer
The Script is impossible.
There are two kinds of Scripts - LocalScripts and regular Scripts. You got two mistake that make correction of this code impossible.
1. Putting LocalPlayer in a Script inside a Part
LocalPlayer doesn't work in normal Scripts.
You also can't just put a LocalScript in a Part, they only run in specific locations, like the character or the Player's descendants.
2. Messing up with Script Types.
As I stated in 1., you can't put LocalPlayer in a Script, denying the usage of a Script, but you also can't put a LocalScript in this kind of button - denying the usage of a LocalScript.
You have to rewrite the whole system for this.
or, you just take a look at this page and you would find out theres a neat argument passed to determine the "LocalPlayer" ;)
1 comment
Thanks a lot, man.