Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Does anyone know how to make it so when a player joins something spawns?

Asked by 6 years ago

Im not sure how to do it correctly!

0
You have to be a bit more specific by what you mean spawn, but just use the PlayerAdded function and Clone:() method. liteImpulse 47 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

You were very vague in your question, but here is an example using the PlayerAdded event of the Players service:

--in a server script
local PartToSpawn = game:GetService("ServerStorage"):WaitForChild("PartToSpawn") or Instance.new("Part")
PartToSpawn.Parent = game:GetService("ServerStorage")

game:GetService("Players").PlayerAdded:Connect(function(player)
    local NewPart = PartToSpawn:Clone()
    NewPart.Parent = workspace
end)
Ad

Answer this question