I have the following:
StarterGui ScreenGui Frame TextBox Script
I want to find the Player's leaderstats (Or leaderboard, as some of you call it), would it look like this? If not, how would it look like?
-- PATH FROM TEXTBOX player = script.Parent.Parent.Parent.Parent.Parent.leaderstats -- Then comes the currencies
I want to find the player that this Gui is in, Not any other player...
First of all, this would be much easier to do in a LocalScript, then you can get your Player easier:
--LocalScript player = game.Players.LocalPlayer
In ROBLOX, you have to make your own Leaderstats.
--ServerScript, put in ServerScriptService game.Players.PlayerAdded:connect(function(plr) Instance.new("IntValue",plr).Name = "leaderstats" Instance.new("NumberValue",plr.leaderstats).Name = "Currency" end)
Once the leaderboard is setup, you can wait for it to load in your LocalScript:
--LocalScript-- player = game.Players.LocalPlayer leaderstats = player:WaitForChild("leaderstats") --etc
One last thing, scripts (LocalScripts atleast) don't work so well within Guis. Then tend to load before the Guis load.
I'd suggest putting them at the route (ScreenGui).