Hey there,
i have this script that is fired from the client when a Humanoid is Touched it fires the Event but does not deal damage?
Local Script:
local Player = game:GetService("Players").LocalPlayer
local rs = game:GetService("ReplicatedStorage")
local Damage = rs:WaitForChild("Damage")
local wep = script.Parent
local input = game:GetService("UserInputService")
local db = false
local cooldown = 5
input.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then print("Clicked")
if db == false then
db = true
wep.Log.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil and db == true then
db = false
Damage:FireServer(hit)
end
end)
end
end
end)
Damage.OnClientEvent:Connect(function()
wait(cooldown)
db = false
end)
Script:
local rs = game:GetService("ReplicatedStorage")
local Damage = rs:WaitForChild("Damage")
local cooldown = .25
Damage.OnServerEvent:Connect(function(hit) print("Fired Server")
if hit.Parent:FindFirstChild("Humanoid") ~= nil then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
end
end)
Thank you!

1 comment
Seems the best way to do it, However what ive written doesnt seem to do damage? Check below. Thanks,