Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago
Edited 6 years ago

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)
0
I got the code blocks to work XD WorkAtChickenPlace 19 — 6y
0
You're setting the fireball's parent to a CFrame and not an object in line 12 Ultimate_Piccolo 201 — 6y
0
How would I make it an object? @Ultimate_Piccolo (nice name XD) WorkAtChickenPlace 19 — 6y

2 answers

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
6 years ago

you do

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

probably misstyped that somehow.

0
I dont think I did, I just checked. WorkAtChickenPlace 19 — 6y
Ad
Log in to vote
0
Answered by
LuaDLL 253 Moderation Voter
6 years ago
Edited 6 years ago
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)

Answer this question