#Weapon damage doesn’t work

1 messages · Page 1 of 1 (latest)

quartz marten
#

Hellooo! Im making a game and am using a knife tool from the toolbox that’s supposed to damage other players. In an empty game if I use the tool it works and does damage, but in my actual game where I have everything else, it does the sounds and stuff but it doesn’t cause any damage. And I’m not changing anything on it in the actual game and my game isn’t laggy or anything it runs smoothly so idk what the problem is, I’d really appreciate some help! I’m not sure if this is a studio or a script thing because I literally can’t tell what the problem is but I’m posting it here!

warm island
#

local DamageEvent = game:GetService("ReplicatedStorage"):WaitForChild("KnifeDamageEvent")
DamageEvent.OnServerEvent:Connect(function(player, targetHumanoid, damage)
-- Validate to prevent exploits
if typeof(targetHumanoid) == "Instance" and targetHumanoid:IsA("Humanoid") then
targetHumanoid:TakeDamage(damage)
end
end)

#

But first add a remoteevent

Create a RemoteEvent in ReplicatedStorage (e.g., KnifeDamageEvent).

#

Then server side damage script Place this in `ServerScriptService

warm island
#

And modify ur tknife script : Replace humanoid:TakeDamage(35) in your tool with:

left stratus
#

Gotcha — I’ve seen this happen a lot with toolbox melee tools when moving from a blank place into a “real” game.
It’s usually not because the script is broken, but because something in your actual game’s setup prevents damage from being applied.

Here are the most common culprits to check:

  1. The tool’s damage script is being blocked by FilteringEnabled / Server-Side checks
    Many toolbox melee tools run on the client and directly change Humanoid.Health.

In an empty baseplate, that works because nothing is stopping it, but in a real game with FilteringEnabled (default now), those changes don’t replicate to the server — so other players won’t take damage.

Fix: Make sure damage is applied on the server (e.g., using a RemoteEvent from the client to tell the server who was hit, then the server sets health).

  1. Custom character systems or hitbox scripts
    If your game has a custom character controller, ragdoll system, or modified Humanoid setup, the knife script might be looking for "Humanoid" in a model but not finding it.

Check that the target’s Humanoid name hasn’t been changed, and it’s still in the same structure the knife expects.

  1. Collision Groups
    If your knife’s hit detection uses .Touched events, but the knife and the player are in collision groups that don’t collide, .Touched will never fire.

Go to Workspace → Collision Groups and make sure the knife’s parts can collide with the player’s hitboxes.

  1. Team / Friendly Fire settings
    Some toolbox weapons check teams and refuse to damage same-team players.

If in your actual game players are on the same team, the script may just skip the damage.

  1. LocalScript running in wrong environment
    If it’s a LocalScript inside the tool, in an empty baseplate it runs fine because the player owns the tool.

In your real game, if you moved the tool to a place like ServerStorage or a location where LocalScripts don’t run, it won’t execute.

left stratus
warm island
#

game:GetService("ReplicatedStorage").KnifeDamageEvent:FireServer(targetHumanoid, 35)

left stratus
#

im helping him

warm island
left stratus
warm island
left stratus
#

lvl 999

left stratus
warm island
#

@vocal nebula shoot you shot

vocal nebula
left stratus
left stratus
#

you do TargetHumanoid:IsA("Humanoid") after it

warm island
#

You are right

left stratus
#

also i think kruz is right

#

its hella exploitable

warm island
#

Here is the corrected validation :

DamageEvent.OnServerEvent:Connect(function(player, targetHumanoid, damage)
-- PROPER validation (order matters for short-circuiting!)
if targetHumanoid and targetHumanoid:IsA("Humanoid") and targetHumanoid.Parent then
local character = targetHumanoid.Parent
-- Optional: Verify target is not the attacker
if character ~= player.Character then
targetHumanoid:TakeDamage(damage)
end
end
end)

#

What do you think

warm island
left stratus
#

exploiter just fires this remote event and passes 999999 damage

vocal nebula
#

yeah

warm island
vocal nebula
#

they could create a loop kill for every player in the server in like 3 seconds

left stratus
vocal nebula
#

oh wait

warm island
vocal nebula
#

They can't loopkill everyone

#

just themselves

left stratus
#

why

warm island
#

How

vocal nebula
#

actually not even that ig

warm island
vocal nebula
#

idek

#

im tired

warm island
#

Lets all use ai

#

And fck off

#

😗😗😗😗

vocal nebula
#

real

warm island
vocal nebula
#

I may have forgot how clients work for like 2 minutes there 😔

left stratus
#
-- FUCKENG EXPLOIT 
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local KnifeDamageEvent = ReplicatedStorage:WaitForChild("KnifeDamageEvent")

for _,v in game.Players:GetPlayers() do
    if v.Character then
        local hum = v.Character:FindFirstChildOfClass("Humanoid")
        
        KnifeDamageEvent:FireServer(hum, hum.Health)
    end
end
#

boom hacked

left stratus
#

exploiters don't care 😭

vocal nebula
#

oh shoot

#

I was correct originally

#

You're passing in a humanoid variable 😭

left stratus
#

ofc

warm island
#

I dont think dollette will keep up with all these texts sob2k

left stratus
#

we won't lel

#

so to fix it

#

hmm

#

wait bruh

warm island
#

Lemme ask an ai real quick

left stratus
#

i didn't even read his msg

vocal nebula
# left stratus make a hitbox system

He's most likely having a problem where he's doing damage on the client and it's not replicating on the server, which yeah I'd just recommend this

left stratus
#

hm

#

first thing is

#

damage variable should be on server

#

and you shouldn't pass it

#

nah just make a hitbox system hehe

vocal nebula
#

He should send in a snippet of what he's doing ngl

#

Might be an entirely other problem

left stratus
#

im just looking at my combat system

left stratus
round mortar
left stratus
round mortar
#

Just let ai do all of the code

left stratus
#

and its not exploitable cuz yeah im pro

left stratus
round mortar
#

Imagine scripting in 2025

warm island
vocal nebula
storm jayBOT
#

studio** You are now Level 6! **studio

round mortar
round mortar
warm island
round mortar
warm island
#

Or he’ll appear

#

And slim you

round mortar
#

Whi

#

Sho

#

Who

warm island
#

China president

#

And deepseek himself

vocal nebula
#

I sure do love that we're helping this guy with his damage so much

#

And not talking about taiwan

warm island
round mortar
warm island
quartz marten
#

HELP WHAT HAPPENED WHILE I WASNT HERE??

#

Okay I hope that in between all those messages there’s a solution 😇

warm island
#

Loose all hope in your game

warm island
#

Only solution

vocal nebula
#

The solution was that you should prob send in a snippet of the code and make a hitbox system

quartz marten
quartz marten
#

That would probably work rlly well actually thx!

round mortar
#

Add script.parent and it will fix

vocal nebula
#

For better results, define a variable of script.Parent, and then use script.Parent for everything else, anyways

quartz marten
round mortar
quartz marten
#

Do I put it in a script inside the tool?

vocal nebula
#

Trust

#

yeah

#

just need a blank script in there with script.Parent

quartz marten
#

I feel like ur all lying to me….😞💔💔💔💔💔

round mortar
#

Bro

#

Do you want to fix it or no

vocal nebula
#

I'd also just make a hitbox system, just to be safe

quartz marten
#

I’m still gonna try it duhhh

#

And thx guys I rlly appreciate the help 🥰🥰

#

Such a sweet community

quartz marten
round mortar
#

❤️

vocal nebula
quartz marten
#

Okay so I just went onto the Knife tool, inserted a script and wrote that

#

Is that right?

round mortar
#

Yes

quartz marten
#

Okay guys I’ll let u know if it works!!!!!! 😇

#

It didn’t work at ALL!!! 💔

vocal nebula
#

I could've never expected this outcome

quartz marten
#

Okay i guess I’ll do the hitbox

round mortar
#

Same...

quartz marten
#

That’s it Im never trusting anyone ever again and it’s all YOUR fault..

vocal nebula
quartz marten
#

Well tbh with how weird scripting is I thought that maybe random stuff like that would work

storm jayBOT
#

studio** You are now Level 4! **studio