Gun given by Proximity Prompt is not working but gun given by StarterPack has no issues

How’s it going ladies and gentleman?

I made a part with a ProximityPrompt and script inside, the script is simple
imagen

It gives you the same gun given by StarterPack, I added it so that testers can grab another one if they die since tools are deleted on death

Here’s the issue: When I get the gun from the ProximityPrompt it gives an error

But the gun that StarterPack gives me works perfectly fine

Here’s the LocalScript and piece of code giving the error

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()


local UIS = game:GetService("UserInputService")


local tool = script.Parent


local Animator = char:WaitForChild("Humanoid"):WaitForChild("Animator")

local animations = script.Parent:WaitForChild("Animations")

local a = animations:WaitForChild("IdleAnim") -- This one gives the error
local b = animations:WaitForChild("FireAnim")


local IdleAnim = Animator:LoadAnimation(a)
local FireAnim = Animator:LoadAnimation(b)


local shooting = false
local shooting_2 = false
local equipped = false

local Cooldown = 0.2

local MuzzleFlash = tool.MuzzleFlashPart.MuzzleFlash


UIS.InputEnded:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		FireAnim:Stop()
		
		shooting = false
	end
end)


script.Parent.Equipped:Connect(function()
	
	game.ReplicatedStorage.RemoteEvent1:FireServer(tool.BodyAttach)
	
	char.Torso.ToolGrip.Part0 = char.Torso
	char.Torso.ToolGrip.Part1 = tool.BodyAttach
	
	IdleAnim:Play()
	game.ReplicatedStorage.RemoteEvent3:FireServer()
	
	equipped = true
end)


script.Parent.Unequipped:Connect(function()
	game.ReplicatedStorage.RemoteEvent2:FireServer()
	
	IdleAnim:Stop()
	game.ReplicatedStorage.RemoteEvent4:FireServer()
	
	equipped = false
end)


UIS.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 and equipped and not shooting and not shooting_2 then
		
		shooting = true
		FireAnim:Play()
		
		while shooting do
			
			game.ReplicatedStorage.RemoteEvent5:FireServer()
			MuzzleFlash.Enabled = true
			shooting_2 = true
			
			task.wait(Cooldown)
			
			MuzzleFlash.Enabled = false
			shooting_2 = false
		end
		
	end
end)

I’m literally so freaking confused right now

The animations used to be inside the LocalScript that you see, now they are inside a folder and it still gives the same error and that makes no REDACTED sense.

This is what the inside of the tool looks like
imagen

Be sure to ask me stuff, I might have missed important stuff that I didn’t show here

Can you show an image of the Tool that is in the ServerStorage? Is it different at all?

The gun inside ServerStorage is just a copy of the original gun which is inside of StarterPack

Wait let me checkThis text will be blurred

You made me solve the problem lol, I was just editing the gun inside StarterPack but I was not applying the same changes on the gun inside ServerStorage which caused the error

Had a feeling they were different. Glad to hear it’s fixed.

Yeah, thanks for prompting me to change the gun lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.