local player = game.Players.LocalPlayer
local function updateText(player)
script.Parent.Text = player:WaitForChild("Values"):WaitForChild("Dimes").Value
end
game.Players.PlayerAdded:Connect(function()
updateText(player)
end)
player:WaitForChild("Values"):WaitForChild("Dimes"):GetPropertyChangedSignal("Value"):Connect(function()
updateText(player)
end)
This isnt showing the value of the Dimes.
What happens if you try using “:FindFirstChild()”?
[13:16:57.327 - FindForChild is not a valid member of Player “Players.U_npluggedDev”]
oop, i said the wrong thing i said for
the text still just said 0 which is what I have it at defaultly
I have like 15 of these, and when one fails the rest work, but if none fail none work.
Can you show us the layout of the player?
Also, you misspelled :FindFirstChild() in the first post. You spelled it FindForChild, it’s FindFirstChild()
All of the currencies are in a folder in the player called “Values”. When the value changes, the text works but until it changes it shows 0.
Yeah I noticed and I fixed it, and it still didnt work.
What kind of value is “Dimes”?
Dimes is an int value which is instancesd.
Wait, so now I’m confused. What seems to be the problem? It says here that when the value changes, the text works.
The :GetPropertyChangedSignal()
method doesn’t work for specific properties I believe - such as Value. You will need to use the .Changed
event in order to do this.
Try this to update the amount of Dimes:
player:WaitForChild("Values"):WaitForChild("Dimes").Changed:Connect(function(property)
if property == "Value" then
script.Parent.Text = player.Values.Dimes.Value
end
end)
Also I don’t think the PlayerAdded is necessary, and the updateText function seemed a little redundant, so I just shortened this down - of course you can choose how you ultimately want to do this, too - just my suggestions.
So play the game and press add next to all of the currencies, then leave so it saves, then rejoin and youll see the problem Money Project - Roblox
No, get property changed signal works fine, its the playerAdded thing thats not working.
Uh, alright. I’ll do that. But if it’s like that, wouldn’t it be a datastore problem or something? Not sure, lemme test it.
its not, since once you click Add or Remove(the 2 buttons) then it changes to the old value +1 or -1 cause add or remove
Ah, so you’re saying that when you rejoin the game, it doesn’t go back to the old one until you add or remove some
Yeah, every time you join it says 0 until you change the value.