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

I'm having trouble with making a monster give xp and gold for an RPG?

Asked by 5 years ago

This is the script that I have inside the monster model. It won't change the values on the leader board when killed like it's supposed to. Can anyone see why not?


local Humanoid = script.Parent.Humanoid -- Change Enemy to the name of your Monsters Humaniod function PwntX_X() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local Leaderstats = tag.Value:findFirstChild("leaderstats") if Leaderstats ~= nil then Leaderstats.Gold.Value = Leaderstats.Gold.Value + 5 --How Much Money Given wait(0.1) script:remove() end end end end Humanoid.Died:connect(PwntX_X) local Humanoid = script.Parent.Humanoid -- Change Enemy to the name of your Monsters Humaniod function PwntX_X() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local Leaderstats = tag.Value:findFirstChild("leaderstats") if Leaderstats ~= nil then Leaderstats.XP.Value = Leaderstats.XP.Value + 5 --How Much Exp Given wait(0.1) script:remove() end end end end Humanoid.Died:connect(PwntX_X)
0
For some reason I feel like this is a half free model.... voidofdeathfire 148 — 5y
0
Also nothing is triggering. This script is an afk script it doesn't do anything voidofdeathfire 148 — 5y
0
So how can i get it to trigger? nicedogy123 0 — 5y
0
What does this line mean: local tag = Humanoid:findFirstChild("creator") 123nabilben123 499 — 5y

Answer this question