local Main = script.Parent
local Players = game:GetService("Players")
local oGUI = script:FindFirstChild('ScreenGui')
Main.Touched:Connect(function(Hit)
local Player = Players:GetPlayerFromCharacter(Hit.Parent)
local PlayerGui = Player.PlayerGui
if oGUI and Player then
Main.Sound:Play()
for n = 0 , 2 , 0.2 do
Main.Sound.Volume = n
print('Hi!')
local GUI = oGUI:Clone()
GUI.Parent = PlayerGui
wait(3)
GUI:Destroy()
for y = 2 , 0 , -0.2 do
Main.Sound.Volume = y
wait(0)
Main.Sound.Volume:Stop()
end
end
end
end)
There is an error : 12:12:01.818 - Workspace.Part.Script:8: attempt to index local 'Player' (a nil value) This is a server script BTW

3 comments
Once you fix that, tell me if there are any other errors, and I'll edit my post to fix them.
Also, you can't access things inside of PlayerGui from a server script, you can put GUI into it, but you can't remove anything or see things in it
Not entirely correct ^. If the server either clones or creates a child and assigns its Parent to a player's PlayerGui, the server can access that child, but it still can't access anything else in the PlayerGui.