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

Why aren't these parts moving sometimes?[ignore current answer]

Hi! I made a gun and it only fires when I'm standing near 0,0,0.

player = game.Players.LocalPlayer
mouse = player:GetMouse()

function fire()
	local part = Instance.new("Part",player.Character)
	part.Size = Vector3.new(2,2,2)
	part.CFrame = CFrame.new(player.Character.Torso.CFrame.p,mouse.Hit.p)
	part.CanCollide = false
	part.Anchored = false
	local vel = Instance.new("BodyVelocity",part)
	vel.Velocity = part.CFrame.lookVector*100
	game.Debris:AddItem(part,3)
end

Whenever I use fire(), it'll only work if I am near 0,0,0. If I'm, say at 5,0,0, it won't work. The parts will just hang in the air.

1 answer

Set the parts parent to the script then immediately back to workspace :3

1 comment

0

Didn't work

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