Want to make a overhead rank system based off the amount of wins you have.
So this was my test script.
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local GuiClone = script.OverheadGui:Clone()
GuiClone.Parent = Character.Head
local InformationLabel = GuiClone.InformationLabel
local plr = game.Players.LocalPlayer
if plr.leaderstats.Wins.Value == 0 then
InformationLabel.Text = Player.Name .. " - Noob"
end
end)
end)
And I got this error!
(Again it makes the label but does not change the text)
(How would I say greater than or equal to rather then just equal to. Is it => or >=?)
1 Like
Instead of defining the player inside a server script with LocalPlayer, you can use the parameter of the PlayerAdded event since LocalPlayer is only for local scripts.
Delete this line and use that parameter.
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local GuiClone = script.OverheadGui:Clone()
GuiClone.Parent = Character.Head
local InformationLabel = GuiClone.InformationLabel
if Player.leaderstats.Wins.Value == 0 then
InformationLabel.Text = Player.Name .. " - Noob"
end
end)
end)
1 Like
How would I achieve this in Roblox code?
The equal symbol always comes second if you compare something.
>=
<=
if plr.leaderstats.Wins.Value >= 0 then
InformationLabel.Text = Player.Name .. " - Noob"
end
1 Like