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

I have an error that ive never seen before and I dont understand it??

-- June 30, 2019
-- Made by IiNaoriku
--put this in StarterPlayerScripts
local rs = game:GetService("ReplicatedStorage")
local gunEvent = rs:WaitForChild("GunEvent")

gunEvent.OnServerEvent:Connect(function(player, startPos, endPos)
	
	 local part = Instance.new("Part")
	local specialMesh = Instance.new("SpecialMesh", part)
	specialMesh.MeshType = Enum.MeshType.Sphere
	
	specialMesh.Scale = Vector3.new(0.1,0.25,4)
	part.Material = Enum.Material.Neon
	part.CFrame = CFrame.new(startPos, endPos)
	
	local bv = Instance.new("BodyVelocity", part)
	bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
	bv.Velocity = part.CFrame.LookVector * 1
	
	part.Parent = game.Workspace.CurrentCamera
	part.CanCollide = false

	part.BrickColor = BrickColor.new("New Yeller")


	
	delay(5, function()

		
	part:Destroy()
	
	end)
	end)

I made a bullet generating code, but it gives me this weird error that I've never seen before. This is the error,

12:16:35.207 - ServerScriptService.bullet:15: bad argument #1 to 'new' (Vector3 expected, got Object)

12:16:35.208 - Stack Begin

12:16:35.208 - Script 'ServerScriptService.bullet', Line 15

Can someone help me with this? Thanks.

1 answer

Maybe try using .Size not .Scale?

1 comment

0

The problem is on line 15, i have to use scale because its a mesh

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