RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Constantly spawn a part on top of every players head every 3 seconds. Add comments to code"
-- server script -- Create a function to spawn a part on top of the player local function spawnPart(player) -- Create the part local part = Instance.new("Part") part.Parent = workspace part.Size = Vector3.new(1, 1, 1) part.Position = player.Character.Head.Position end -- Create a loop to spawn the part every 3 seconds while true do -- Loop through all the players for _, player in pairs(game.Players:GetPlayers()) do -- Spawn the part spawnPart(player) end -- Wait 3 seconds wait(3) end