There are a few problems.
Problem 1
The functions aren't being called, they are just being defined. When a function is defined, it does not run (example #1).
Also, since by default, GUIs load every time a player spawns, your functions are not needed because they will only need to run once (example #2).
As well as that, you don't need to make heaps of different functions (example #3)
Example #1
function printText(text)
print(text)
end
printText("yes")
function playerAdded(plr)
print(plr.Name.. " has joined the game!")
end
game.Players.PlayerAdded:connect(playerAdded)
Example #2
local group_id = 0000
local player = game.Players.LocalPlayer
local header = script.Parent:WaitForChild("header")
local rank = player:GetRankInGroup(group_id)
if rank == 1 then
header.Text = "Rank: Trainee"
end
Example #3
function spawned()
if rank == 1 then
elseif rank == 2 then
end
end
Useful link for if statements: https://www.youtube.com/watch?v=7aEa6MDNaCs
Problem #2
You can easily get a player's rank name in a certain group using this function:
player:GetRoleInGroup(group_id)
Hope I helped!
Note that I am in a rush, so there may be some errors or discrepancies here and there.
~TDP
2 comments
What's the error?
there is none showing