01 | player = script.Parent.Parent.Parent.Parent.Parent |
02 | cost = 500 |
03 |
04 | function checkForColt() |
05 | found = false |
06 | for i, v in pairs (player.Backpack:GetChildren()) do |
07 | if v.Name = = "Colt" then |
08 | found = true |
09 | end |
10 | end |
11 | for i, v in pairs (player.Charater:GetChildren()) do |
12 | if v.Name = = "Colt" then |
13 | found = true |
14 | end |
15 | end |
My leaderboard stats work fine, it out put's no errors and the colt is correctly labeled. 10+ cookiez to the guy the works it out.
You comitted several errors:
01 | player = game.Players.LocalPlayer -- LocalPlayer, LocalScript! |
02 | cost = 500 |
03 |
04 | function checkForColt() |
05 | found = false |
06 | for i, v in pairs (player.Backpack:GetChildren()) do |
07 | if v.Name = = "Colt" then |
08 | found = true |
09 | end |
10 | end |
11 | for i, v in pairs (player.Charater:GetChildren()) do |
12 | if v.Name = = "Colt" then |
13 | found = true |
14 | end |
15 | end |
Well, i'm not a proscripter. But try to put it inside a LocalScript instead of a normal one (I guess you used the normal one) - Do not get mad if it do not work. I tryed at least.
01 | player = game.Players.LocalPlayer |
02 |
03 | cost = 500 |
04 |
05 |
06 |
07 | function checkForColt() |
08 |
09 | found = false |
10 |
11 | for i, v in pairs (player.Backpack:GetChildren()) do |
12 |
13 | if v.Name = = "Colt" then |
14 |
15 | found = true |
So, I've re-written, but it read's errors I don't know how to solve.
"Charater is not a valid member of player." I tried Humanoid too, but no luck. Those cookies are still up for grabs!