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?
COMMUNITY QUESTION
If a player is not in group it makes a instance message into workspace?
1 answer
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!
This discussion is preserved as it was. New answers, comments, and votes are closed.
