I’m trying to make some sort of script that gives a certain GUI to players when a tool is equipped, by cloning the Gui and then setting its parent to the PlayerGui, there’s only an issue. It doesn’t give any GUI. The script outputs no error, nor in F9 Console. Does anyone know how to help?
local player = game.Players.LocalPlayer
script.Parent.Equipped:Connect(function()
local clone = game.ReplicatedStorage.ScreenGui:Clone()
clone.Parent = player.PlayerGui
script.Parent.Unequipped:Connect(function()
clone:Destroy()
end)
end)
The issue is that the player isnt specifed so the game doesn’t know what to do.
(The server doesnt know what to do with the variable because it doesnt know who to give the GUI to)
I don’t want to put it inside PlayerGui because people with the intent of exploit can easily enable it with the use of Dev Explorer or whatever it’s called.
Yeah, the output should be erroring “clone”, also it’s not erroring because the unequip function is inside the equip function, so there’s no need to return the “clone” variable.