Basically making a sword fighting system and for some odd reason when I fire the event it returns the actual player and the players name.
-- LOCAL local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.Button1Down:Connect(function() if player.Character.ExtraData.Armed.Value == true then local WeaponName1 = script.Weap.Value local WeaponName = WeaponName1 print(WeaponName) print("Is armed L") if player.Character:FindFirstChild(WeaponName) then print("Found Weapon L") local Weapon = player.Character:FindFirstChild(WeaponName) game.ReplicatedStorage.Combat.Slash:FireServer(player, Weapon) end end end)
-- SERVER local thing1 = game.ReplicatedStorage.Combat.Slash thing1.OnServerEvent:connect(function(player, Weapon) print("Slash Fired S") print(Weapon.Name)
That is the only part of the serverscript it does, yes the actual script has ends and all that. But you see when it prints the sword name for the local it prints ("Starter") (The sword name) but when it prints for the server it prints my username. I have also tried to just send the name of the item instead of the item itself to the server and it still won't work at all and just sends my username on the server.
You don't need to send the player through the localscripts arguments try only sending the weapon tell me if it works or not
-- LOCAL local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.Button1Down:Connect(function() if player.Character.ExtraData.Armed.Value == true then local WeaponName1 = script.Weap.Value local WeaponName = WeaponName1 print(WeaponName) print("Is armed L") if player.Character:FindFirstChild(WeaponName) then print("Found Weapon L") local Weapon = player.Character:FindFirstChild(WeaponName) game.ReplicatedStorage.Combat.Slash:FireServer(Weapon) end end end)