of     1   

fret13103
#141488498Friday, July 25, 2014 9:54 AM GMT

I'm having trouble navigating inside the player model I have a touched event, and I'm using "hit" (I have instantiated the "hit", and checked "hit.Parent" has a "Humanoid" in it) So when I try to do this: hit.Parent.leaderstats.Money It's like I'm in the completely wrong area, and I can't see what is inside the player model. I can see that leaderstats is in there,but not where hit.Parent would be, so I can't adjust myself, does anybody know how I could do this?
AnonyAnonymous
#141488798Friday, July 25, 2014 10:02 AM GMT

Could you show us more of the script and explain the hierarchical order of the objects?.
128GB
#141488889Friday, July 25, 2014 10:04 AM GMT

local player = Game.Players:GetPlayerFromCharacter(hit.Parent) if player then --make sure it was a player, to keep from erroring player.leaderstats.Money.Value = 0 end
fret13103
#141488939Friday, July 25, 2014 10:05 AM GMT

Yeah. game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("Model", player) leaderstats.Name = "leaderstats" local money = Instance.new("IntValue", leaderstats) money.Value = 250 money.Name = "Money" when a player joins they are given the leaderstats model. SCRIPT 2: the one throwing the errors function Touched(hit)if hit and hit.Parent and hit.Parent:findFirstChild("Humanoid") then if hit.Parent.Name == sp.Parent.Parent.Parent.Owner.Boss.Value then hit.Parent.leaderstats.money.Value = hit.Parent.Parent.leaderstats.Money.Value+sp.Parent.Collect end end end script.Parent.Touched:connect(Touched)
fret13103
#141488964Friday, July 25, 2014 10:06 AM GMT

btw the leaderstats is fine, its just picking up money from a block that isn't working.
AnonyAnonymous
#141489067Friday, July 25, 2014 10:08 AM GMT

What kind of "Object" is "Collect"?.
128GB
#141489084Friday, July 25, 2014 10:09 AM GMT

script.Parent.Touched:connect(function(hit) local player = Game.Players:GetPlayerFromCharacter(hit.Parent) if player then local Money = player:WaitForChild("leaderstats"):WaitForChild("Money") Money.Value = Money.Value + 10 end end)
fret13103
#141489126Friday, July 25, 2014 10:10 AM GMT

Collect is an Integer.
AnonyAnonymous
#141489222Friday, July 25, 2014 10:12 AM GMT

Then, try using something such as, sp.Parent.Collect.Value If that's what you meant.
fret13103
#141489316Friday, July 25, 2014 10:15 AM GMT

Hey, uh, 128 I edited your code, and it is still not working. hit.Parent.leaderstats.money.Value Isn't the right nav, I can't even see what is inside the player area because it is all hidden... ffs.
fret13103
#141489344Friday, July 25, 2014 10:15 AM GMT

@anon sorry, it was off the page and I didn't copy it X_X
fret13103
#141489421Friday, July 25, 2014 10:17 AM GMT

Okay, fixed it, thanks for the help Anon and 128 :) I owe you both.

    of     1