So, I'm making a script and I made a function that is called by :MouseButton1Click() so in the function I made the parameters "plr" and in the function I made this line "if plr.Parent.Parent.PlayerHasBase.Value == false then" and it doesn't work, because the output says plr = nil so then I need help, how do I get the player from a click? Because my way doesn't work.... :c Full script:
function SpawnBase(plr) if plr.Parent.Parent.PlayerHasBase.Value == false then local Base = game.ServerStorage.Base:Clone() Base.Parent = plr.Character Base:MoveTo(game.Workspace.Spawn1.Position) end end script.Parent.MouseButton1Click:connect(SpawnBase)