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

Why won't any weapons other then the classic sword work with my kill for money script on ROBLOX?

Alright so recently i posted a question on this site about how to make a kill for money script.Somebody fixed my script and it works! but the only problem is it doesn't work with any weapons other then the classic sword. I have tried to put the script inside the weapons and all that but it wont work. Any suggestions?

local Humanoid = script.Parent.Zombie ;
	 
	Humanoid.Died:Connect(function()
	    local tagValue = Humanoid:WaitForChild("creator").Value;
	    local leaderstats = tagValue:WaitForChild("leaderstats");
    leaderstats.Cash.Value = leaderstats.Cash.Value + 7;
	    wait(0.1);
	    script:Destroy();
	end);

Also I'm using free model guns if your wondering.

2 comments

0

Not all scripts use the same method of indicating that a person was killed by someone else.

0

So do I have to add a script to the weapon?

1 answer

✓ Accepted answer

Simple answer is to not use free models, or if you do, at least edit them. The issue is that not every weapon or script indicates the killer in the same way, if at all. It is impossible to get the killer from an entity with no indicator as to who killed them. You could go about adding a StringValue into the zombie upon being killed, with the value of the killer's name. This would have to be done within the weapon script though.

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