Hey Developers!
What I’m trying to do is once a player joins a group, and join back on the game, they get a “reward”. Although that reward could be anything such as cash and such. But I just want to know HOW do you reward them once they join a group? I’ve looked throughout everywhere but cannot find how this is done. If I could get any help on this, it’d be amazing!
1 Like
You can check their role in the group via Player:GetRoleInGroup(groupid)
, where Player
is the Player instance and groupid
is the id of your group. You can have a PlayerAdded set up so when a player joins, check their Role, if their role is not Guest
(not in the group), give them a reward. I think this can also be done using GetRankInGroup
too
Or IsInGroup
, I had a great brain fart, but all 3 of the things mentioned will work
local groupid = 12345
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRoleInGroup(groupid) ~= "Guest" then
--Do stuff
end
end)
6 Likes
Did you look at Player | Roblox Creator Documentation?
local GroupID = 0000000000000000000000000000000000000000000000 --Yeah idk
game.Players.PlayerAdded:Connect(function(Player)
if Player:IsInGroup(GroupID) then
--Do stuff
end
end)
Returns true
if the player is in the group, otherwise returns back false
(Might wanna mark 1 of our posts as a solution preferably @EmbatTheHybrid’s, don’t just change the Topic please )
6 Likes