I’m making a script for an axe that does damage when it’s hit. TakeDamage is going to be done on the server, obviously, so i’m using a RemoteEvent. For some reason, doing
-- local script inside tool, this is the part that fires the remoteevent
script.Parent.Handle.Touched:Connect(function(hit)
if hit and canSwing == false then
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum and hum ~= plrHum then
local selected = hitsounds[math.random(1, #hitsounds)]
selected:Play()
game.ReplicatedStorage.Damage:FireServer(hum, 15)
end
end
end)
and
local RS = game:GetService("ReplicatedStorage")
local Event = RS:WaitForChild("Damage")
Event.OnServerEvent:Connect(function(hum, amount)
hum:TakeDamage(amount)
end)
gives me this in output when i swing at a dummy.
TakeDamage is not a valid member of Player "Players.milkmanthememer" -- milkmanthememer is my main account im creating this game on