function die()
script.Parent.Parent.Parent.ShopFrame.Visible = false
script.Parent.Parent.Parent.Frame.TextLabel.Visible = true
local player = game.Players.LocalPlayer
player.Character.Torso.Anchored = true
end
script.Parent.MouseButton1Down:connect(die)
What it does is it makes the other guis not to be shown and is supposed to anchor the player when in shop.

2 comments
Try changing your script into a localscript (if it isn't one already)
It's might be because you need to 'repeat wait() until player.Character'? Sometimes roblox stuffs up with this stuff