Can someone please fix this script. It doesn't seem to work. This script is placed in the part. The click detector is inside the part along with the script.
button = script.Parent
function onClicked (part)
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player ~= nil then
local GUI = game.Lighting.ScreenGui
GUI:Clone().Parent = player.PlayerGui
end
end
end
button.Touched:connect(onTouch)

2 comments
Nevermind haha. I fixed it on my own.. Thanks for the answer though.
No problem.