Game has filtering enabled turned on, and the local script is located in: game.StarterGui.ScreenGui.Frame.ImageButton.Shopscript
local GUI = script.Parent.Parent.Parent
local imagebutton = script.Parent
local Replistore = game:GetService("ReplicatedStorage")
local Frame = script.Parent.Parent
local MoveGui = Frame:WaitForChild("CloseGui")
local Shopbulletin = Frame.TextLabel
local SHOPbutton = game.Workspace.SHOPbutton
local Buttondebounce = true
local openagain = true
function checkplayer(otherpart)
local humanoid = otherpart.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil then
plr = game.Players:GetPlayerFromCharacter(otherpart.Parent)
points = plr.leaderstats.Points
end
end
function checkpurchase()
local checksword = plr.Backpack:FindFirstChild("ClassicSword")
if points.Value >= 40 and checksword == nil then
points.Value = points.Value - 40
Replistore.ClassicSword:Clone().Parent = plr.Backpack
Replistore.ClassicSword:Clone().Parent = plr.StarterGear
elseif checksword ~= nil then
Shopbulletin.Text = "You already have a sword!"
wait(1.5)
Shopbulletin.Text = "Welcome to the place shop!"
else
local Text = script.Parent.Parent.TextLabel
local temppoints = 40 - points.Value
Shopbulletin.Text = "You need to have "..temppoints.." more points!"
wait(1.5)
Shopbulletin.Text = "Welcome to the place shop!"
end
end
function closegui()
Frame:TweenPosition(UDim2.new(-1.5, 0, 0, 0))
wait(1.5)
script.Parent.Parent.Visible = false
openagain = true
end
function opengui()
script.Parent.Parent.Visible = true
Frame:TweenPosition(UDim2.new(0.25, 0, 0, 0))
openagain = false
wait(1.5)
end
function Openshop(otherpart)
if not Buttondebounce and not openagain then
return
end
Buttondebounce = false
checkplayer(otherpart)
SHOPbutton.BrickColor = BrickColor.Red()
opengui()
wait(1)
SHOPbutton.BrickColor = BrickColor.Gray()
Buttondebounce = true
end
imagebutton.MouseButton1Click:connect(checkpurchase)
MoveGui.MouseButton1Click:connect(closegui)
SHOPbutton.Touched:connect(Openshop)
I've tested this in a test local server w/ two players, and when one player touched the button, the Gui showed up for both players, even for the other player who didn't touch the button. I intended for the gui to just show up for the player who pressed the button, and I'm not sure what to do from here. Thanks in advance!

1 comment
Can you add in some prints to find what is being ran when and where.