Hi guys! I have a tool which is in the backpack. In the script in the tool, I try to change a value which is in the player but for some reason I get the error that "Products is not a valid member of Model"?! This is the hierarchy.
Player \/ (in the player are these...)
Backpack -Tool -Script in tool that changes the value
Products - Value I am trying to change called Cash
I am using this script.
script.Parent.Parent.Products.Cash.Value = 0
Any ideas? Thanks
Your problem is that when you actually equip a tool it's parent becomes your character, rather than your player's backpack.
So to fix? Use a localscript in your tool and define the player as game.Players.LocalPlayer
.
Example;
local plr = game.Players.LocalPlayer plr.Products.Cash.Value = 0
NOTE: Check to make sure you're indexing the correct areas! In a normal leaderboard setup then the hierarchy is;
Player
~ leaderstats
~ ~ Money
Locked by Goulstem and Redbullusa
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?