i have problems with this gui a lot so i will tell everything about it. i am making a warning gui when players coin leaderstats reach a certain amount and you use a toll to gain coins. I have a script in coins which fires a remote event which is in replicated storage and its picked up by this script. here are things you should know my gui is in starter gui all buttons have local scripts
game.ReplicatedStorage.CoinsEvent.OnServerInvoke:Connect(function(player) if player.leaderstats.coins.Value = player.Capacity.Value then player.PlayerGui.Warning.Frame.Visible = true end)
this part works but i think i should tell this because i think that server thinks that gui is not on from the server side so it dosent pick up when buttons in that gui are cuz they are just on from client side. Anyways there are two buttons in the gui close and shop. My close script works so i will not mention it and here is the main problem
shop script
local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() local char = player.Character char.Humanoid.CFrame = CFrame.new(--Position of my shop) end)
I hope you guys can help Thank You
EDIT:The shop script never works and does not teleport players
You typed = instead of == which means equal to
if player.leaderstats.coins.Value == player.Capacity.Value then char.HumanoidRootPart.CFrame = CFrame.new(--Position of my shop)