Theres a command called :pb, its to spawn a ball. It works but if theres a ball trail it dosen’t. How can I fix that?
{{'publicball','pb'},{'Spawns a public ball infront of a player'},0,{'player'},function(pl,args)
if workspace.Configuration.SpawnPublicBall.Value == true then
for _, player in pairs(args[1]) do
for i, v in pairs(workspace:GetDescendants()) do
if v:FindFirstChild("PB") then
if v.PB.Value == player.Name then
v:Destroy()
end
end
end
local ball = game.Lighting.TPS:Clone()
local offset = Vector3.new(0,-1.6,-5)
ball.PB.Value = player.Name
ball.CFrame = player.Character.Torso.CFrame * CFrame.new(offset)
ball.Parent = game.Workspace.Balls
end
end
end},
{{'publicball','pb'},{'Spawns a public ball infront of a player'},0,{'player'},function(pl,args)
if workspace.Configuration.SpawnPublicBall.Value == true then
for _, player in pairs(args[1]) do
for i, v in pairs(workspace:GetDescendants()) do
if v:FindFirstChild("PB") then
if v.PB.Value == player.Name then
v:Destroy()
end
end
end
local ball = game.Lighting.TPS:Clone()
ball.PB.Value = player.Name
ball.CFrame = player.Character.Torso.CFrame * CFrame.new(0,-1.6,-5)
ball.Parent = game.Workspace.Balls
end
end
end},
I just set the offset values to the cframe.new arg then now it should work