Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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.

0
Not all scripts use the same method of indicating that a person was killed by someone else. Unhumanly 152 — 4y
0
So do I have to add a script to the weapon? CamCIutch 4 — 4y

1 answer

Log in to vote
0
Answered by
commag 228 Moderation Voter
4 years ago

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.

Ad

Answer this question