I've been trying to create an specific part inside my torso that's stored in ServerStorage. however, i've been having problems (Workspace.JamarMario.Script:3: bad argument #1 to 'new' (string expected, got Object)). i need help with this one folks.
local damagingball = game.ServerStorage.damagingball local shootsstuff = game.ServerStorage.shootsstuff Instance.new(shootsstuff) shootsstuff.Position = game.Players.LocalPlayer.Character.Torso.Position shootsstuff.Anchored = true
there's other stuff down there but i don't think it's related to the problem since it's a completely different code.
When you use instance.new
, you are creating a new instance (Ex.Part, Sound). You need to use :clone()
instead. Here is what your script should look like:
local damagingball = game.ServerStorage.damagingball local shootsstuff = game.ServerStorage.shootsstuff:clone() shootsstuff.Position = game.Players.LocalPlayer.Character.Torso.Position
Note: This only makes the part's location to the player's torso position once. If they move, the part will stay where it originally was. You'll need to weld or attach it to the player's torso if you want to have it move with them.
Hope this helps!