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

Why won't the ball spawn at the players position?

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	local original = workspace.Ball
	local copy = original:Clone()
	local character = player.Character or player.CharacterAdded:wait()
	local CF = character:WaitForChild("HumanoidRootPart").Position
	copy.Parent = original.Parent
	copy.CFrame = CFrame.new(CF)
end)

2 comments

0

:wait() is deprecated. Use :Wait() instead. Why don't you set the parent of the copy to "workspace" on line eight?

0

Add a wait(1) before line 07. Your characters position will be in the air somewhere in the middle of the baseplate.

1 answer

you got the position of the humanoid root part cframes use cframes not positions you would have to do copy.Position = CF but heres the fixed script

math.randomseed(tick()) -- can remove but added just incase
local Players = game:GetService("Players")	 
Players.PlayerAdded:Connect(function(player)
	    local original = workspace.Ball
	    local copy = original:Clone()
	    local character = player.Character or player.CharacterAdded:Wait()
	    local CF = character:WaitForChild("HumanoidRootPart").Position
	    copy.Parent = original.Parent
	    copy.Position = CF -- (or Vector3.new(CF))
end)

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