How the script works/issue: When a player clicks on a part via a click detector a gui appears but it appears for all of the players which is not ideal. My script is a normal script but I don't know if I should use a local script or if a local script will even work.
Any help?
Script:
local brick = script.Parent
local deb = false
function onClicked(plr)
if deb == false then
deb = true
for i,v in pairs(game.Players:GetPlayers()) do
local PlayerGui = v.PlayerGui
PlayerGui.Fade.Frame.Visible = true
PlayerGui.Fade.Frame.BackgroundTransparency = 0.9
wait(0.1)
PlayerGui.Fade.Frame.BackgroundTransparency = 0
wait(3)
for i = .1,1,.1 do
PlayerGui.Fade.Frame.BackgroundTransparency = i
wait(.1)
PlayerGui.Fade.Frame.Visible = false
deb = false
end
end
end
end
script.Parent.mouseClick:connect(onClicked)

1 comment
Line 6, you're putting it inside eveyone's gui.