This is my script.
local Gui = script.Parent.ShopGui:clone() function onTouched(hit) local human = hit.Parent:findFirstChild("Humanoid") local life = human.Parent.Name if (human ~= nil ) then local Gui = script.Parent.ShopGui:clone() Gui.Parent = game.Players.LocalPlayer.PlayerGui end end script.Parent.Touched:connect(onTouched)
In test mode, it works fine. But in online mode, the gui doesn't appear.
On line 8 you are using "game.Players.LocalPlayer" If this script is not a local script then that can not be used. You could just find the player
local Gui = script.Parent.ShopGui:clone() function onTouched(hit) local human = hit.Parent:findFirstChild("Humanoid") local life = human.Parent.Name if (human ~= nil ) then local Gui = script.Parent.ShopGui:clone() Gui.Parent = game.Players:FindFirstChild(Life):WaitForChild("PlayerGui") end end script.Parent.Touched:connect(onTouched)