Hey everyone, I'm new here. I was wondering how I'd be able to make a TextButton that when clicked, would check if the user has a gamepass and if they do, execute the code
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 64
and if not, prompt them to purchase the gamepass. How would this be possible? Thanks! Also, is it safe to put the purchase checking code in localscript or not?

6 comments
I'm not sure if I get this. It's meant to happen when a TextButton is clicked.
Check my script again I updated it
Thank you, but how do I prompt them to buy it?
On line 9 where you see "checkpass" add "else" then the prompt purchase function
thank you!
Accept his answer :P