So this tool is supposed to kill any player it touches EXCEPT the player. I've even made it detect if a player is the same player that is holding tool. The issue that lies is that it's still killing the player!
LocalScript inside Tool:
local tool = script.Parent
local debounce = false
local equipsound = tool.Sounds.Equip
local slashsound = tool.Sounds.Slash
local killsound = tool.Sounds.Kill
local isActive = script.Parent:WaitForChild("Values").isActive
local replicatedstorage = game:GetService("ReplicatedStorage")
print("Loaded...")
tool.Equipped:Connect(function(Mouse)
print("Loaded....")
equipsound:Play()
Mouse.Icon = "rbxasset://textures/GunCursor.png"
local char = script.Parent.Parent
local knifehold = char.Humanoid:LoadAnimation(script.Parent.Animations.KnifeHold)
knifehold:Play()
tool.Activated:Connect(function()
if debounce == false then
print("Loaded.....")
isActive.Value = true
debounce = true
slashsound:Play()
local chosenanim = math.random(1,3)
print("Loaded......")
local anim = script.Parent.Animations["Slash"..chosenanim]
local slash1 = char.Humanoid:LoadAnimation(anim)
slash1:Play()
wait(0.5)
isActive.Value = false
debounce = false
end
end)
tool.Unequipped:Connect(function()
knifehold:Stop()
Mouse.Icon = ""
end)
end)
tool.Handle.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:WaitForChild("Humanoid") then
if hit.Parent.Humanoid.Health > 0 then
if hit.Parent ~= game.Players.LocalPlayer.Character and hit.Parent.Parent ~= game.Players.LocalPlayer.Character then
replicatedstorage.KillEvent:FireServer(hit.Parent)
killsound:Play()
end
end
end
end)
ServerScript inside Tool:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local KillEvent = ReplicatedStorage:WaitForChild("KillEvent")
KillEvent.OnServerEvent:Connect(function(player)
local plr = game.Workspace[player.Name]
plr.Humanoid:TakeDamage(100)
end)

2 comments
thanks, but does this mean i have to edit my localscript to say ":FireServer(player,argument)"
nope. when the server gets the request, the first argument is the player. the second argument from the server is the first argument the client fired.