local oGUI = script:FindFirstChild("ScreenGui") script.Parent.Touched:Connect(function(toucher) local player = game:GetService("Players"):FindFirstChild(toucher.Parent) if player then print("Hi!") local GUI = oGUI:Clone() GUI.Parent = player.PlayerGUI wait(1) GUI:Destroy() end end)
I'm trying to create a thing where if you touch it a custom GUI pops up , for some reason nothing happens at all PS: This is a server script
local Main = script.Parent -- Our part to touch local Players = game:GetService("Players") -- Player Service local Debris = game:GetService("Debris") -- Debris Service local oGUI = script:FindFirstChild('ScreenGui') -- Our gui Main.Touched:Connect(function(Hit) -- Touched Connection & Touched Arguement local Player = Players:GetPlayerFromCharacter(Hit.Parent) -- The player who touched if oGUI and Player then -- Checking if gui and player exists print('Hi!') local GUI = oGUI:Clone() -- Cloning our gui GUI.Parent = Player.PlayerGui -- Parenting into PlayerGui so player can see it Debris:AddItem(GUI, 1) -- waits 1 then gui is destroyed. end end)
Hopefully this suits your needs, tell me if it works.