Basically, I am having trouble with my gamepass run perk. The user buys it in game, they reset and boom the GUI should appear. So you'd think, but it doesn't. It works in Studio, but when the person who owns the gamepass leaves and re-joins the game, the GUI doesn't appear, same goes for when they reset. I'll post my script so hopefully one of you good fellow Roblox'ers can help.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if game.MarketplaceService:PlayerOwnsAsset(player,996728468) then
character.Humanoid.WalkSpeed = 75
game.Players.LocalPlayer.PlayerGui.NoticeGUI.Note.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui.Run.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui.Walk.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui.TextButton.Visible = false
end
end)
end)
Thanks for your time and I hope you can help me out.

28 comments
Thanks, I'm still stuck as it's saying NoticeGUI is not a valid member of PlayerGui. I've no idea why it isn't moving to the Players GUI but I really need to know how.
Try using WaitForChild.
Sorry, I'm a newbie to scripting. What line would I add this to? Thanks.
I'll edit my answer for you.
Done.
Thanks. It still won't appear and it says in the console "Infinite yield possible on 'Players.N30_Vehicle.PlayerGui:WaitForChild("NoticeGui")'
Then maybe the NoticeGui isn't cloning and/or is misspelled.
Where is the NoticeGui anyway?
It's all spelled correctly. I really have no idea how else to tackle this issue but it seems like it might be a Roblox problem since you've tried everything.
Where is it located?
It's in StarterGui.
Is it called NoticeGUI or NoticeGui?
NoticeGUI.
Just did some research, replace WaitForChild with FindFirstChild. That should work for you.
I'm clueless. I really do appreciate your help, don't know why this still isn't working. Just says "Attempt to index a nil value"
Me too. But if my answer at least helped you please accept it, it would mean alot.
Does it depend on where the script is? I put it into ServerScriptService.
Also, I don't seem to have an accept answer button? What does it look like because there's nothing but an upvote system.
Oh. You need to put the script in the workspace. The accept answer button would be on the top right of my answer.
ServerScriptService can't access GUIs.
I don't seem to have an answer button. I turned off Ad Block to see if I could find it but it's still not there? Strange.
Oh, I'm sorry. It's located at the bottom of my answer, right here: https://gyazo.com/da46502d4328b3520ea4d26ee4275caf
I only have the Report icon which baffles me. I just signed up today so do I need to wait 24 hours before I can accept answers?
Yeah, that might be the problem. Just remember to accept since it'll help my reputation and yours :)
I will definitely remember. You really have helped me a lot trying to get this to work, thank you very much for your time and contribution.
LOL, I got it. FilteringEnabled is on which is what interferes with my script. I'm so so so so sorry to ask but do you know how to get around it without turning it off?
I wouldn't recommend turning FilteringEnalbed off, as it will ruin your game. You might want to research on how FE is good.
I understand now. I just want to know how do I get my script to adapt to working with FilteringEnabled on?