I am trying to spawn a copy of a brick that I made, but it says :Unable to create an Instance of type "modeledAttacker". Here is the code
local base = script.Parent local modeledAttacker = game.Workspace.attacker function createAttacker() attacker = Instance.new("modeledAttacker",Workspace) -- problem originates here attacker.Position = Vector3.new( -33, 3, 18) end createAttacker()
Ok, so to create an exact instance of an instance that already exists, use :Clone()
So, to fix your problem:
local base = script.Parent local modeledAttacker = game.Workspace.attacker function createAttacker() attacker = modeledAttacker:clone() -- You clone it here attacker:MakeJoints() -- Keeps the model together, just to be sure attacker.Parent = game.Workspace -- When you clone it the parent defaults to nil attacker.Position = Vector3.new( -33, 3, 18) end createAttacker()