hello im making a house system but i have a problem when a player left the game here is the script
local casa = workspace.casaAvere local text = script.Parent.test.teSTO.SurfaceGui.TextLabel local name = script.Parent.test.teSTO.name game.Players.PlayerRemoving:Connect(function(player) if player.Name == name.Value then text.Text = "house for sale ,give 50 bobux to bobux man" wait(.2) name.Value = nil wait(.2) casa.Value = false end end)
there is the error Workspace.left1:8: invalid argument #3 (string expected, got nil)
local casa = workspace.casaAvere local text = script.Parent.test.teSTO.SurfaceGui.TextLabel local Name = script.Parent.test.teSTO.name game.Players.PlayerRemoving:Connect(function(player) if player.Name == Name.Value then text.Text = "house for sale ,give 50 bobux to bobux man" wait(.2) Name.Value = "nil" wait(.2) casa.Value = false end end)
i fixed it