I am trying to have a script detect if something is Nil, and if it is, it'll just give the player a copy of the Loaded bool but it's giving me the error "Loaded is not a valid member of Player" and not going through the rest of the script. Any idea why?

local player = game.Players.LocalPlayer
local loaded = script.Loaded

if player.loaded == nil then 
	script.Loaded:Clone().Parent = player
end

if player.Loaded == true then 
	player.PlayerGui.Music.MusicPanel.Visible = true
	player.PlayerGui.PlayButton.PlayPanel.Visible = true
end

1 comment

0

use :FindFirstChild()