Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

If a player is not in group it makes a instance message into workspace?

Asked by 11 years ago

Does anyone know how to make it so if someone is not in a certain group, it will put a message that says "Player [playername] is not in group", and it will put it up on screen so people see it?

1 answer

Log in to vote
0
Answered by
sgsharp 265 Moderation Voter
11 years ago

I'm not exactly sure what you mean, but I have made a script for you that may or may not do what you want... Here you go.

To add your group, get the group ID and replace the 000000 with the new group ID...

01g={000000} -- Group ID
02 
03function check_groupStatus(player)
04    inGroup = false
05    for i,p in pairs(g) do
06        if player:IsInGroup(p) then
07            inGroup = true
08        end
09    end
10    return inGroup
11end
12game.Players.PlayerAdded:connect(function(player)
13    if not check_groupStatus(player) then
14        local h = Instance.new ("Message")
15        h.Parent = game.Workspace
16        h.Text = (player.Name.. " is not in the group.") -- A public message that says this player isn't in the group.
17        wait(6)
18        h:remove ()
19    end
20end)

Hope this helped!

Ad

Answer this question