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 10 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
10 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...

g={000000} -- Group ID

function check_groupStatus(player) 
    inGroup = false 
    for i,p in pairs(g) do 
        if player:IsInGroup(p) then 
            inGroup = true 
        end 
    end 
    return inGroup 
end 
game.Players.PlayerAdded:connect(function(player) 
    if not check_groupStatus(player) then 
        local h = Instance.new ("Message")
        h.Parent = game.Workspace
        h.Text = (player.Name.. " is not in the group.") -- A public message that says this player isn't in the group.
        wait(6)
        h:remove () 
    end 
end) 

Hope this helped!

Ad

Answer this question