Why does nothing happen after the remote is fired?
Localscript(Placed in StarterPlayerScripts)
1 | local rs = game:GetService( "ReplicatedStorage" ) |
2 | local ranking = rs:WaitForChild( "Ranking" ) |
3 | local plr = game.Players.LocalPlayer |
4 | plr.CharacterAdded:Connect( function (char) |
Script (Placed in ServerScriptService
01 | local rs = game:GetService( "ReplicatedStorage" ) |
02 | local ranking = rs:WaitForChild( "Ranking" ) |
04 | ranking.OnServerEvent:connect( function (player) |
07 | warn( "an error occured fetching the player" ) |
10 | local groupService = game:GetService( 'GroupService' ) |
11 | local groups = groupService:GetGroupsAsync(player.UserId) |
12 | local ui = script.Rank:Clone() |
13 | ui.Parent = player.Character |
14 | ui.Adornee = player.Character.Head |
16 | while not player.Character.Humanoid do wait() end |
17 | player.Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None |
18 | local frame = ui.Frame |
19 | local name = frame.Main |
20 | local title = frame.Title |
21 | for _,groupInfo in pairs (groups) do |
22 | if groupInfo.Id = = 4489568 then |
23 | if groupInfo.Role = = ranks [ 1 ] or groupInfo.Role = = ranks [ 2 ] or groupInfo.Role = = ranks [ 3 ] or groupInfo.Role = = ranks [ 4 ] or groupInfo.Role = = ranks [ 5 ] or groupInfo.Role = = ranks [ 6 ] or groupInfo.Role = = ranks [ 7 ] or groupInfo.Role = = ranks [ 8 ] or groupInfo.Role = = ranks [ 9 ] or groupInfo.Role = = ranks [ 10 ] or groupInfo.Role = = ranks [ 11 ] or groupInfo.Role = = ranks [ 12 ] or groupInfo.Role = = ranks [ 13 ] or groupInfo.Role = = ranks [ 14 ] or groupInfo.Role = = ranks [ 15 ] or groupInfo.Role = = ranks [ 16 ] or groupInfo.Role = = ranks [ 17 ] or groupInfo.Role = = ranks [ 18 ] or groupInfo.Role = = ranks [ 19 ] then |
24 | name.Text = player.Name.. ", " ..groupInfo.Role |
26 | name.Text = player.Name.. ", " .. "Guest" |
ModuleScript(Child of the Script)
01 | local ranks = { "President" , |
09 | "Professional Team Member" , |
The gui doesn't show up above the players head, there are no errors in the output and the remote has fired correctly.