Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I see a players currency, then do something with that currency?

while true do
	print(game.Players.LocalPlayer.level.lvl.Value)
	wait(1)
end

So this is my second time writing this (note to self, do not refresh the page when you've written something) and I'm still stumped. Anyways, I'm trying to make a spin off of piggy, (I think, I've never played that game) and my idea is a story. Kinda like a long Airplane game. Anyways, I am trying to make an unlock system, so that the player doesn't just jump to the last chapter? I haven't named them yet. For some reason the output error is "level is not a valid member of Player." So make this easier to answer, I uploaded a decal (because I don't know how to give a link to a photo). www.roblox.com/library/5194952811/thing-thing-thing-thing-thing of the explorer. I hope this helps! Thanks for reading and/or helping!!! Ok! After about an hour of waiting my account was warned because, that wasn't appropriate for roblox. It was just the explore of my game! Fine, so Ill just use google docs. I don't know if you can edit the doc or not. https://docs.google.com/document/d/1ouCj32xzh8TIXkwZNLxnvZ-hv9u8VwPibp4PMC3J75E/edit?usp=sharing This was a wild ride trying to get an answer. Anyways, Have a good day!

3 answers

✓ Accepted answer

Well, to find out when a property has changed you can use:

local plr = game.Players.LocalPlayer
local l = plr:WaitForChild("level")
local i = l:WaitForChild("lvl")
i:GetPropertyChangedSignal("Value"):Connect(function()
    print(game.Players.LocalPlayer.level.lvl.Value)
end)

Make sure it is in a local script!

What does the error mean?

The error means. Level does not exist. Make sure Level does exist inside the player. And your image uploaded to Roblox got well.. Content Deleted

I fixed it myself, I just remade the code to include a line that says:

workspace.lvl.Value = game.Players.LocalPlayer.level.lvl.Value

I still have no idea why the other code didn't work ¯_(?)_/¯. That code is inside of a local script thats in a GUI

This discussion is preserved as it was. New answers, comments, and votes are closed.