local playerName = game.Players.LocalPlayer.Name
game.Players.PlayerAdded:Connect(function()
local rand = math.random(1,2,3,4)
if game.Workspace.Signs["Sign"..rand].SurfaceGui.TextLabel.Text == "Empty House" then
game.Workspace.Signs["Sign"..rand].SurfaceGui.TextLabel.Text = playerName.."'s House"
elseif game.Workspace.Signs["Sign"..rand].SurfaceGui.TextLabel.Text ~= "Empty House" then
repeat place = math.random(1,2,3,4)
until game.Workspace.Signs["Sign"..rand].SurfaceGui.TextLabel.Text == "Empty House"
if game.Workspace.Signs["Sign"..rand].SurfaceGui.TextLabel.Text == "Empty House" then
game.Workspace.Signs["Sign"..rand].SurfaceGui.TextLabel.Text = playerName.."'s House"
end
end
end)
This is a LocalScript that I made for house owning. So basicly if your first join this server It get's the name and do math.random for choosing a random house, and in the house sign, it will say "PlayerName's House" But it doesn't work.

1 comment
Your math is going to produce the same number every time the script runs. Look into math.randomseed. Also it may be easier to add a stringvalue inside the part and check it’s value.