PaintBall gun dont working

Hello dev’s! I know i maked topic simmilar with this. But roblox printing " Fire is not a valid member of Tool “Players.plr.Backpack.PainBallGun”"

Local srcipt:

local p = script.Parent
local fe = p.Fire
local lp = game.Players.LocalPlayer
local m = lp:GetMouse()
local rs1 = 0.5
local rs2 = 2
local b = 30
local db = true
local al = nil
local al2 = nil
local al3 = nil


p.Equipped:Connect(function()
	local hum1 = lp.Character.Humanoid
	if hum1 ~= nil then
		al3 = hum1:LoadAnimation(p.Handle.Idle)
		al3:Play()
	end
end)

p.Activated:Connect(function()
if b >= 0 then
	if db then
		db = false
		local hum = lp.Character.Humanoid
		if hum ~= nil then
			al = hum:LoadAnimation(p.Handle.Shot)
			al:Play()
		end
		fe:FireServer(m.Hit)
		wait(rs1)
			db = true
		end
	else
		if db == true then
			db = false
			local hum = lp.Character.Humanoid
			if hum ~= nil then
				al = hum:LoadAnimation(p.Handle.Fire)
				al:Play()
				wait(rs2)
				db = true
			end
		end
	end
end)

p.Unequipped:Connect(function()
	if al3 then
		al3:Stop()
		al3 = nil
	end
end)

Server script:

local p = script.Parent
local h = p.Handle
local fe = p.Fire
local rs1 = 150

fe.OnServerEvent:Connect(function(plr,aim)
	local rp = game.ServerStorage.Ball:Clone()
	rp.BrickColor = BrickColor.random()
	rp.Parent = workspace
	rp.CFrame = CFrame.new(h.RocketAttachment.WorldPosition,aim.Position)
	rp.Velocity = rp.CFrame.LookVector * rs1
	h.Fire:Play()

	local bf = Instance.new("BodyForce")
	bf.Parent = rp
	bf.Force = Vector3.yAxis * workspace.Gravity * rp.Mass

	rp.Touched:Connect(function(hit)
		if hit:IsDescendantOf(plr.Character) then
		local h = hit:FindFirstChild("Humanoid")
			if h then
				h.Health = h.Health - 30
			end
			rp:Destroy()
		end
	end)
end)



image

5 Likes

Maybe instead of
local fe = p.Fire
do
local fe = p:WaitForChild("Fire")

2 Likes

This is worked, but i have this LOL :sweat_smile:

image

1 Like

I might be wrong but maybe you havent set the animation priority of the animation to action when exporting.

1 Like

What is this man? I new in roblox animations. And im not used export.

1 Like


Before uploading the animation to roblox, make sure to set animation priority to Action.

1 Like

ok im checking)))))))))))) :ok_hand: :ok: :ok_hand:

1 Like

It’s actual animation have priority “Action”
image
Sorry, my english is bad.