I'm trying to make a function which when a player joins it creates a new part in a different position, I want them to separate by adding to the position. Here is the code I used:
`game.Players.PlayerAdded:Connect(function(newbuildingspot)
local NewBuildingSpot = Instance.new("Part") NewBuildingSpot.Parent = game.BuildingSpotFolder NewBuildingSpot.Size(3,5,50) NewBuildingSpot.BrickColor = BrickColor.new("Beige") NewBuildingSpot.Position(+0,+12,+15) `
end) Mainly concerned on the last one and wanted I hope that someone with more experience can point out my error/s.
You should use a Local Script, which only affect on player's client (only himself, like the Minecraft ender chest)
game.Players.PlayerAdded:Connect(function(player) local NewBuildingSpot = Instance.new("Part", player.CurrentCamera) NewBuildingSpot.Parent = game.BuildingSpotFolder NewBuildingSpot.Size(3,5,50) NewBuildingSpot.BrickColor = BrickColor.new("Beige") NewBuildingSpot.Position(math.Random(0,12), math.Random(0,15)) -- Randomize the Building Spot's Position end)