Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make official roblox weapon kit only damage non player humanoids?

I am stuck for 3 hours now...I am working on a game with those guns. I dont want the players to kill eachother, only the enemys. The enemys in the game are only humanoids and not other players.

So basically i dont know how to modify the kit that it only kills humanoids.

1 answer

✓ Accepted answer

Go to WeaponsSystem module script under the WeaponsSystem folder. Scroll down to line 427 where it says:

local function _defaultDamageCallback(system, target, amount, damageType, dealer, hitInfo, damageData)
	if target:IsA("Humanoid") then
		target:TakeDamage(amount)
	end
end

Change that entire function to:

local function _defaultDamageCallback(system, target, amount, damageType, dealer, hitInfo, damageData)
	local player = game.Players:GetPlayerFromCharacter(target.Parent)
	if not player and target:IsA("Humanoid") then
		target:TakeDamage(amount)
	end
end

Let me know if that works.

1 comment

0

Thanks Alot, it works now :D

This discussion is preserved as it was. New answers, comments, and votes are closed.