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
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
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
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