I’ve made a shop where as if you touch a block a shop will open. However when I test it in the real game, it seems like the gui Opens for everyone. I couldn’t find the issue as other Gui’s which are the same just switched with Mousebutton1down works perfectly fine.
Edit: It is a local script within the gui.
Here is the script:
local open = false
local player = game.Players.LocalPlayer
local Showcase = script.Parent.Frame.Showcase
local ShopGui = player.PlayerGui:WaitForChild(“Shop”).Frame
OpeningBlock.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChildWhichIsA(“Humanoid”)
if humanoid then
if open == false and ShopGui.Visible == false then
exit.Visible = true
frame.Visible = true
frame:TweenPosition(
UDim2.new(0.5, 0,0.55, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Elastic,
1.5,
true,
nil
)
exit:TweenPosition(
UDim2.new(0.675, 0,0.18, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Elastic,
1.5,
true,
nil
)
Showcase.ImageLabel.Image = game.ReplicatedStorage.Shop:FindFirstChild("Jetpacks"):FindFirstChild(player.JetPackSave.JetPackEquipped.Value).Image.Value
Showcase.Fuel.Text = game.ReplicatedStorage.Shop:FindFirstChild("Jetpacks"):FindFirstChild(player.JetPackSave.JetPackEquipped.Value).Fuel.Value
Showcase.Price.Text = game.ReplicatedStorage.Shop:FindFirstChild("Jetpacks"):FindFirstChild(player.JetPackSave.JetPackEquipped.Value).Price.Value
Showcase.Title.Text = game.ReplicatedStorage.Shop:FindFirstChild("Jetpacks"):FindFirstChild(player.JetPackSave.JetPackEquipped.Value).Title.Value
player.Character.Humanoid:UnequipTools()
open = true
end
end
end)