Right now I am struggling with detecting if a player kills another and if so giving them money per that kill. So this is my current KO script and what I have to give the killer more value in that data.value
local function PlayerWhomstDied(PlayerKilled) local humanoid = PlayerKilled.Character["Humanoid"] local tag = humanoid:findFirstChild("creator") if tag then if tag.Value.Name == PlayerKilled.Name then print("Dont kill yourself :(") else print(tag.Value.Name.. " oof-ed you up good ha gottem") local killer = tag.Value.Name killer.Folder.DATA2.Value = killer.Folder.DATA2.Value + 1 end else print("Creator not found :(") PlayerKilled.Folder.DATA3.Value = PlayerKilled.Folder.DATA3.Value + 1 end end game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(c) local hum = c:WaitForChild("Humanoid") hum.Died:connect(function() PlayerWhomstDied(Player) end) end) end)
Oh and the red error i get whenever trying to give myself the plus 1 DATA2.Value would be " ServerScriptService.KO:11:attemkpt to index field 'Folder' (a nil value) " I do understand its something on the 11th line with reaching the folder that holds my data values but I dont know what :^(
Any help would be appericated!