I have an invisible part that triggers when a player touches it. here is my method
function onTouch(Hit) hum = Hit.Parent:FindFirstChild("humanoid") if hum ~= nil then --here is where the code gets executed end end script.Parent.Touched:Connect(onTouch)
However, I cannot figure out the part where you transfer the parent of the Gui from serverstorage to PlayerGui. I even do not know if I should use localscript or regular script.
off the top of my head im pretty sure this should work
function onTouch(Hit) hum = Hit.Parent:FindFirstChild("humanoid") if hum ~= nil then local clone = game.ServerStorage.NameOfGui:Clone() -- clone the gui local player = game.Players:GetPlayerFromCharacter(Hit.Parent) -- grab player clone.Parent = player.PlayerGui -- clone into playergui end end script.Parent.Touched:Connect(onTouch)