workspace.NoobStuff.NoobProxPrompt1.ProximityPrompt.Triggered:Connect(function(bought)
local friends = bought:WaitForChild("leaderstats").Friends
if friends.Value >= 10 then
workspace.NoobStuff.NoobBought1.Transparency = 0
workspace.NoobStuff.NoobProxPrompt2.ProximityPrompt.Enabled = true
workspace.NoobStuff.NoobProxPrompt1.ProximityPrompt.Enabled = false
friends.Value -=10
end
end)
I want the script to check if a player has 10 or more “friends”, which is the leaderstat, and if they do, remove 10 from the player’s “friends”, and some extra things that already work.
There is no error in the output, but nothing happens. I’ve guessed that it has something to do with line three and that I am just putting the wrong area to find the leaderstat.
I have looked on the dev hub but only found things for other problems, and I tried to change line 3 a bit, but nothing.
Any help would be appreciated.
workspace.NoobStuff.NoobProxPrompt1.ProximityPrompt.Triggered:Connect(function(bought)
local friends = bought:WaitForChild("leaderstats"):WaitForChild("Friends")
if friends.Value > 9 then
workspace.NoobStuff.NoobBought1.Transparency = 0
--i didn't read the script well...
workspace.NoobStuff.NoobProxPrompt2.ProximityPrompt.Enabled = true
workspace.NoobStuff.NoobProxPrompt1.ProximityPrompt.Enabled = false
friends.Value -= 10
end
end