It says that "-1" is my UserID

  1. What do you want to achieve? I want to know why it says that “-1” is my UserId, “-1” isn’t my UserID

  2. What is the issue? In the StringValue, there should be my UserID, but there is “-1”

  3. What solutions have you tried so far? I looked on devforum and asked on Discord servers.

local Plots = game.Workspace.Plots

game.Players.PlayerAdded:Connect(function(plr)
	for _, plot in Plots:GetChildren() do
		if plot.Taken.Value == false then
			plot.Taken.Value = true
			plot.Owner.Value = plr.UserId --Here: When I run the game, the value is "-1"
			print("plot gave to"..plr.Name)
			break
		end
	end
end)

The weird thing is, it only shows “-1” at a LocalServer test, but when I run the game normally it shows my right UserId?

1 Like

The clients you get when running a local server aren’t actual accounts that exist on Roblox, just temporary clients.

4 Likes

Thank you for the answer, :slight_smile:
Now I understood the reason

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.