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

Help! Why Dont You get Money when you kill someone!?Are the tags wrong!?!? {TAG PROBLEMS}???

Asked by
Tizzel40 243 Moderation Voter
5 years ago
Edited 5 years ago

Here is the script YOU Are supposed to get + 50 dollars when you kill someone but that isn't work

HELP me Please

what is wrong with the tag system?

local RODE = game.ReplicatedStorage:FindFirstChild("RewardOnDeath_Event")



game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)

        char.Humanoid.Died:Connect(function()
            if char.Humanoid and char.Humanoid:FindFirstChild("creator") then

                player:WaitForChild("Dollars").Value = player:WaitForChild("Dollars").Value + 50

                print(tostring(char.Humanoid.creator.Value).." Has Killed "..char.Name)


            end
--          
        end)
    end)

        end)

Nothing is working at all.....

LOOK AT VIDEO PROOF:https://gyazo.com/baa4dda0c10755e11581d92f9e24f97d

0
is this a prank? DinozCreates 1070 — 5y
0
no want me to post a video? Tizzel40 243 — 5y
0
you need to fix that formatting before my eyes start bleeding DinozCreates 1070 — 5y
0
uhhh what? Tizzel40 243 — 5y
View all comments (12 more)
0
you have 20 spaces and 10 lines of code. start there. DinozCreates 1070 — 5y
0
All right The VIDEO Has Been Posted.NOW SLOWLY take a look at the Dollars. Tizzel40 243 — 5y
0
i fixed your formatting below, please change the above code to that so others can properly read it. also you have a variable with what looks like a remote event and its never called, why? DinozCreates 1070 — 5y
0
It will be called as so as this killing tag system issue is resolve. That remote event was supposaly supposed to fir the client and pop up a gui say that you killed "So and So". Tizzel40 243 — 5y
0
mmh well im pretty sure you're rewarding the person who died not the person who killed them. DinozCreates 1070 — 5y
0
? Tizzel40 243 — 5y
0
check and see if the guy whos dying is receiving any cash DinozCreates 1070 — 5y
0
ok Tizzel40 243 — 5y
0
Nope none of the guys are recieving cash.......: https://gyazo.com/e5d41bdf685ccf97b2658d9075ba5df6 Tizzel40 243 — 5y
0
I dont know...Does Creator require some thing?Or the tag system? I really need this fixed so I can reward exp and cash to the players.This is one of the final problems I have in my game until I can release it........ Tizzel40 243 — 5y
0
Creator thing is outdated just use your own method User#24403 69 — 5y
0
This isn't working because you're pretty much using Char for both the person killed and person who killed the other person. You also didn't define creator automatically going into the Humanoid when the player joined. TheOnlySmarts 233 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

not an answer just fixing his formatting

local RODE = game.ReplicatedStorage:FindFirstChild("RewardOnDeath_Event")

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        char.Humanoid.Died:Connect(function()
            if char.Humanoid and char.Humanoid:FindFirstChild("creator") then
                player:WaitForChild("Dollars").Value = player:WaitForChild("Dollars").Value + 50
                print(tostring(char.Humanoid.creator.Value).." Has Killed "..char.Name)
            end           
        end)
    end)
end)
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Maybe try adding this to your code:

  local tag = character.Humanoid:FindFirstChild("creator")
     if tag ~= nil then
        if tag.Value ~= nil then
        player:WaitForChild("Dollars").Value = player:WaitForChild("Dollars").Value + ? --Whatever you want

The script finds creator and finds the money (int value) and it adds a new value to it.

Not sure if it will work. I am not very good but hope I helped somehow.

Answer this question