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

I am trying to make a fireball, what does the error, "bad argument #3" mean?

I am trying to make a fireball, and I am following along someones tutorial online. It was made in 2016 so I thought that it would work ok. I am getting this error

17:46:18.068 - Workspace.FiredEvent:12: bad argument #3 to 'Parent' (Object expected, got CFrame)

Here is my stuff that I copied,

game.Workspace.Fired.OnServerEvent:connect(function(Player)
local yum = Player
local fireball = Instance.new("Part")
fireball.Name = "Fireball"
fireball.Size = Vector3.new(1.04, 1.04, 1.04)
fireball.Transparency = 0

fireball.CanCollide = false

local fire = Instance.new("Fire")
fire.Parent = fireball
fireball.Parent = yum.Character.HumanoidRootPart.CFrame*CFrame.new(0,1,-6)




	
end)

And I am calling it from a local script inside a tool, here is local script,


local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local RemoteEvent = game.Workspace.Fired
	script.Parent.Activated:connect(function()
		RemoteEvent:FireServer(Player)
	end)

3 comments

0

I got the code blocks to work XD

0

You're setting the fireball's parent to a CFrame and not an object in line 12

0

How would I make it an object? @Ultimate_Piccolo (nice name XD)

2 answers

you do

fireball.Parent = yum.Character.HumanoidRootPart.CFrame*CFrame.new(0,1,-6)

probably misstyped that somehow.

1 comment

0

I dont think I did, I just checked.

game.Workspace.Fired.OnServerEvent:connect(function(Player)
local yum = Player
local fireball = Instance.new("Part")
fireball.Name = "Fireball"
fireball.Size = Vector3.new(1.04, 1.04, 1.04)
fireball.Transparency = 0

fireball.CanCollide = false

local fire = Instance.new("Fire")
fire.Parent = fireball
fireball.Parent = yum.Character
fireball.CFrame= yum.Character.HumanoidRootPart.CFrame*CFrame.new(0,1,-6)
end)

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