Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I add a new object every time a player joins?

So I want to make it so that every time a player gets added a new part gets added as well, but I just can't get it to work (only adds a new part once), here's my script (server script)

local part = game.Workspace.Part
local partClone = part:Clone()
local ps = game:GetService("Players")

ps.PlayerAdded:Connect(function()
	partClone.Parent = game.Workspace
	partClone.Anchored = false
	partClone.Position = Vector3.new(0, part.Position.Y + 1.3, 0)
end)

1 answer

Apart from asking a dumb question I managed to make the script finally which just makes a new part instance every time a player joins instead of cloning an object provided. here's the script if any one is interested

game:GetService("Players").PlayerAdded:Connect(function()
	local part = Instance.new("Part")
	part.Parent = game.Workspace
	part.Position = Vector3.new(0,0.5,0)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.