local playerpos = game.Players.(insert username).Character.Torso.CFrame
local op = Instance.new(“Part”,Workspace)
op.Position = Vector3.new(playerpos)
Im trying to make a ball that spawns at the player, but i dont really know how. I tried getting the torso’s CFrame value (playerpos is the CFrame value) and put it into a Vector3(). Any help? Thanks.
I don’t really know when this code is supposed to run so I just put it in a Players.PlayerAdded event
game.Players.PlayerAdded:Connect(function(player)
if player then
local Character = player.Character or player.CharacterAdded:Wait()
if Character then
local playerpos = Character and Character:FindFirstChild("Torso") and player.Character.Torso.CFrame.Position
if playerpos then
local op = Instance.new("Part", workspace)
op.Position = playerpos
end
end
end
end)