So instead of doing IsNotInGroup(), which is not a function, you can just add an else statement to your IsInGroup() function. I have edited your code below to show what I mean. You had it all correct, all you needed to do was add an else. I hope this helps.
03 | function onPlayerRespawned(newPlayer) |
05 | if newPlayer:IsInGroup(groupid) then |
06 | gui = Instance.new( "BillboardGui" ) |
07 | gui.Parent = newPlayer.Character.Head |
08 | gui.Adornee = newPlayer.Character.Head |
09 | gui.Size = UDim 2. new( 3 , 0 , 1.25 , 0 ) |
10 | gui.StudsOffset = Vector 3. new( 0 , 3 , 0 ) |
11 | texta = Instance.new( "TextBox" ) |
12 | texta.Size = UDim 2. new( 1 , 0 , 1 , 0 ) |
13 | texta.BackgroundTransparency = 1 |
14 | texta.TextScaled = true |
15 | texta.TextColor 3 = Color 3. new( 255 , 255 , 255 ) |
16 | texta.Text = ( "- " .. newPlayer:GetRoleInGroup(groupid) .. " -" ) |
18 | w = game.Lighting.WepsGroup:GetChildren() |
20 | w [ i ] :Clone().Parent = newPlayer.Backpack |
23 | gui = Instance.new( "BillboardGui" ) |
24 | gui.Parent = newPlayer.Character.Head |
25 | gui.Adornee = newPlayer.Character.Head |
26 | gui.Size = UDim 2. new( 3 , 0 , 1.25 , 0 ) |
27 | gui.StudsOffset = Vector 3. new( 0 , 3 , 0 ) |
28 | texta = Instance.new( "TextBox" ) |
29 | texta.Size = UDim 2. new( 1 , 0 , 1 , 0 ) |
30 | texta.BackgroundTransparency = 1 |
31 | texta.TextScaled = true |
32 | texta.TextColor 3 = Color 3. new( 255 , 255 , 255 ) |
33 | texta.Text = ( "Customer" ) |
35 | w = game.Lighting.WepsGroup:GetChildren() |
37 | w [ i ] :Clone().Parent = newPlayer.Backpack |
42 | game.Players.PlayerAdded:connect(onPlayerRespawned) |
45 | function onPlayerEntered(newPlayer) |
46 | newPlayer.Changed:connect( function (property) |
47 | if (property = = "Character" ) then |
48 | onPlayerRespawned(newPlayer) |
53 | game.Players.PlayerAdded:connect(onPlayerEntered) |