New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
0

# hi I search some help please to fix My screen gui ?

Hi I've tryed to do a gui who it will show the money that we will earn (4 guy in game and it will show it like a global leaderboard but only for the money) but i don't know how to do it I try to do something but It won't work....

here is the script:

local Players = game:GetService("Players")
local indicateur = math.random(1,4)

if indicateur == 1 then
end

if indicateur == 2 then
end

if indicateur == 3 then
end

if indicateur == 4 then
end


end)

any Idea to fix it ?

0
Nowaha 444
5 months ago
Edited 5 months ago

You are currently trying to get leaderstats inside of the Players array, but you're probably trying to get it inside of the player.

You can also use the elseif ... then statement instead of all the seperate if statements to increase performance, because it will now check them all, but if you use else if it will only check if the previous one was not true.

local Players = game:GetService("Players")

local indicateur = math.random(1,4)

if indicateur == 1 then
elseif indicateur == 2 then
elseif indicateur == 3 then
elseif indicateur == 4 then
end
end)

0
I got an error at the last end at line 14 of your script I don't know why inconue88 3 — 5mo
0
Sorry, fixed it now! I used "else if" because I'm used to different languages, but it's supposed to be together; "elseif". Nowaha 444 — 5mo
0

To Nowaha :ok so it's didnt show error but it's stil don't work so, in this script, I want to do a thing, it's if the n°1 is taked so take another one but I don't know how to do please could you write me what did i need to do ? here is the script:

local player = game.Players.LocalPlayer
local indicateur = math.random(1,4)

if indicateur == 1 then
end

if indicateur == 2 then
end

if indicateur == 3 then