I’m sorry if this bothers u but im putting out a simulator that includes a backpack limit (currency) Can someone pls help me with the script. Doesn’t print any error
my script:
local plr = game.Players.LocalPlayer
while wait() do
script.Parent.Text = "Player Clicks: "…plr.leaderstats.Clicks.Value… tonumber(plr[‘Click Backpack’].Value)
end
let me know if I did something wrong
1 Like
what are you trying to do here?
Is it not working? We need more information to help you.
its like those games with a limited currency backpack
if u still don’t understand me:
like 0 / 10
10 is the backpack limit or something like that
1 Like
What is happening right now, is the text showing the wrong thing? I think that to concatenate stings you use two dots, not three.
local plr = game.Players.LocalPlayer
while wait() do
script.Parent.Text = "Player Clicks: "..plr.leaderstats.Clicks.Value.."/".. tonumber(plr[‘Click Backpack’].Value)
end
local plr = game.Players.LocalPlayer
while wait() do
if plr.leaderstats.Clicks.Value ~= plr[‘Click Backpack’].Value then
script.Parent.Text = "Player Clicks: "…plr.leaderstats.Clicks.Value… tonumber(plr[‘Click Backpack’].Value)
end
end
nvm I figured it out
script:
local plr = game.Players.LocalPlayer
while wait() do
script.Parent.Text = "Player Clicks: “…plr.leaderstats.Clicks.Value…” / "…tonumber(plr[‘Click Backpack’].Value)
end
1 Like
idk how to print like that so it might render 3 dots
also forgot to mention, when the player reaches the maximum amount of storage the player can’t click no more until they sell
am actually wondering how to post like that
Type this:
```
< Code there
```
wheres the code print(“hello”) is the code?
1 Like
Yes it is. As you see on the right of the screen shot the "print(“Hello)” is formatted.
again im trying to find out a way when the player’s inventory(currency) is equal to the backpack then a gui will pop up this is what I have
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local Frame = PlayerGui:WaitForChild("CurrencyMax").Background
local leaderstats = Player:FindFirstChild("leaderstats")
while wait() do
if Player.leaderstats.Clicks.Value == tonumber(Player.leaderstats['Click Backpack'].Value) then
game.StarterGui.Click.TextButton.LocalScript.Disabled = true
PlayerGui.Frame.Visible = true
end
end
if u are asking if it in a localscript/script
a: LocalScript
You cant index a string with a number so tonumber it
while wait() do
if tonumber(Player.leaderstats.Clicks.Value) == tonumber(Player.leaderstats['Click Backpack'].Value) then
game.StarterGui.Click.TextButton.LocalScript.Disabled = true
PlayerGui.Frame.Visible = true
end
end
holy I forgot about the tonumber