I'm trying to make it so my weapon from my camera can be cloned and shown to other players but when I do my script I have a print name to see if things are working but it prints my name twice even though I changed the value? I don't know here.
Local Script-
local servergun = rep.Events.GetGun:InvokeServer(player,pri, sec)
if servergun == true then
print("YaY")
end
Server Script-
game.ReplicatedStorage.Events.GetGun.OnServerInvoke = function(player, pri, sec)
print(player.Character.Name)
print(pri.Name)
local function getgun()
local servergun = game.ReplicatedStorage["Weapon Models"][pri.Name]:Clone()
servergun.Parent = player.Character
local weld = Instance.new("Weld", player.Character.RightHand)
weld.Part0 = player.Character.RightHand
weld.Part1 = player.Character[pri.Name].Body
end
return true
end
I'm not good with these so I don't understand what I'm doing wrong! Here's the output
GameBoyOtaku GameBoyOtaku YaY
so it does work kinda but it's showing my name twice... why though?

2 comments
is pri.Name the player's name?
pri is a primary weapon it's an object that's in the camera