local pos1 = {250, 0, 250}
local pos2 = {-250, 0, -250}
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function()
local part = Instance.new("Part", game.Workspace)
part.Anchored = true
part.Position = Vector3.new(math.random(#pos1, #pos2))
end)
end)
I am struggling please help.

3 comments
The positions work but how can I make it so every time it's a different position because when I test it, it creates a random position but spawns in the same position
put the x, y, z before local part
Yeah, that would work just put lines 2 through 4 below line 7