I tried putting this script in the monster local Humanoid = script.Parent.Human function PwntX_X() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local theinventory = tag.Value:findFirstChild("PlayerGui").Inventory2 local theinventoryparts = theinventory:GetChildren() for i, v in pairs(theinventoryparts) do wait(0.5) if v.SlotValue.Value == "" then v.SlotValue.Value = "Wood" --Change this to desired variable so you can have any weapon v.Ammt.Value = 5 v.SlotLabel.Text = v.Ammt.Value v.SlotImage.Image = "http://www.roblox.com/asset/?id=539465370" break elseif v.SlotValue.Value == "Wood" then v.Ammt.Value = v.Ammt.Value + 5 v.SlotLabel.Text = v.Ammt.Value break --This script we just wrote will make it so you can stack wood end end wait(0.1) script:remove() end end end Humanoid.Died:connect(PwntX_X) but it doesn't seem to work
01 | local Humanoid = script.Parent.Human |
02 | function PwntX_X() |
03 | local tag = Humanoid:findFirstChild( "creator" ) |
04 | if tag ~ = nil then |
05 | if tag.Value ~ = nil then |
06 | local theinventory = tag.Value:findFirstChild( "PlayerGui" ).Inventory 2 |
07 | local theinventoryparts = theinventory:GetChildren() |
08 | for i, v in pairs (theinventoryparts) do |
09 | wait( 0.5 ) |
10 | if v.SlotValue.Value = = "" then |
11 | v.SlotValue.Value = "Wood" --Change this to desired variable so you can have any weapon |
12 | v.Ammt.Value = 5 |
13 | v.SlotLabel.Text = v.Ammt.Value |
14 | v.SlotImage.Image = "http://www.roblox.com/asset/?id=539465370" |
15 | break |
You should also give the output so that it is easier to help you.
One thing I speculate is that it doesn't work because there is no child in the character (or it may not actually be a character) named "Human".
Also, I think maybe it does not work because the tag doesn't exist when you kill the monster.