Guns not taking damage?

Randomly my gun server script doesn’t work any help?
(These scripts duplicate my gun.) (The serverscript worked fine until I used these scripts to duplicate the guns)
local script

local Event = game:GetService("ReplicatedStorage"):WaitForChild("GiveGun")
local name = script.Parent.Name

script.Parent.MouseButton1Down:Connect(function()
	Event:FireServer(name)
	script.Parent.Parent.Visible = false
end)

server script

local Event = game:GetService("ReplicatedStorage"):WaitForChild("GiveGun")

Event.OnServerEvent:Connect(function(player, name)
	local character = player.Character
	local Clone = game.Workspace:WaitForChild("Guns"):FindFirstChild(name):Clone()
	Clone.Parent = character
	Clone.Handle.Anchored = false
end)

These scripts clone the gun but the server script doesent work on the gun anymore? any help?

1 Like

Could describe with more detail what’s the issue?

The raycast script for my gun is not firing after I clone the gun into the character

Does it work when you don’t clone the gun into the character?

yes it does work when I dont clone

disable the scripts in the gun and when you clone it into the players backpack, enable them.

does not work still… asdfgh78lll

try to print on both of the functions and see if they run. If they don’t then reply back.

local Event = game:GetService("ReplicatedStorage"):WaitForChild("GiveGun")

Event.OnServerEvent:Connect(function(player, name)
    print("Success")
	local character = player.Character
	local Clone = game.Workspace:WaitForChild("Guns"):FindFirstChild(name):Clone()
	Clone.Parent = character
	Clone.Handle.Anchored = false
end)

And

local Event = game:GetService("ReplicatedStorage"):WaitForChild("GiveGun")
local name = script.Parent.Name

script.Parent.MouseButton1Down:Connect(function()
    print("Success2")
	Event:FireServer(name)
	script.Parent.Parent.Visible = false
end)

the gun goes into the character and get’s unanchored, is that right or am i missing something?

they work fine it was just that my raycast script is broken.