I have this script so that when you step on a part in the workspace it will open the GUI. The problem is that when someone steps on the part it opens for the entire server. I have made it so it is a local script inside of Starter GUI, but it is not inside of any GUIs it is just by itself in the Starter GUI. Please help.
game.Workspace.ShopButton.Touched:Connect(function(hit)
if hit then
script.Parent.ShopGUI.Frame.Visible = true
end
end)
or
local Activated = false
game.Workspace.ShopButton.Touched:Connect(function(hit)
if hit.Name == “Left Leg” or hit.Name == “Right Leg” and Activated == false then
Activated = true
script.Parent.ShopGUI.Frame.Visible = true
end
end)
while true do
if script.Parent.ShopGUI.Frame.Visible == false then
Activated = false
end
end
script.Parent.Touched:Connect(function(hit)
-- player
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player then
-- gui stuff
local PlayerGui = Player.PlayerGui
if PlayerGui then
-- make it visible
local Gui = GUI_PATH_HERE
Gui.Enabled = not Gui.Enabled
end
end
end)
script.Parent.Touched:Connect(function(hit)
– player
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player then
– gui stuff
local PlayerGui = Player.PlayerGui
if PlayerGui then
– make it visible
local Gui = script.Parent.ShopGUI.Frame
Gui.Enabled = not Gui.Enabled
end
end
end)
We have it placed inside of the starter GUI. It does not work.