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

How i can apply a script only when a player is joined or not in group?

Asked by 3 years ago
Edited 3 years ago

When someone is joined in a group what i select then apply a script what I scripted so I think: Script to apply the script when someone is joined in the group" workspace.example:Play() workspace.example.Transparency = 0 workspace.example.CanCollide = false And when is he not joined in the group then apply another script what ONLY work when is he not joined in the group so I think: *Script what apply ONLY when a player Is not joined in the group workspace.example:Play()

1 answer

Log in to vote
0
Answered by 3 years ago

You can't apply a script when someone has joined a certain group. But you can do this.

Inside a script, if you would like something to happen you would use Player:IsInGroup(GroupID) to accomplish this :)

Alright, so I'll show you how it's done.

Add a script inside ServerScriptService.

Inside that script you would type :



local GroupId = 0000000 -- Put the group id here, game.Players.PlayerAdded:Connect(function(player) if player:IsInGroup(GroupId) then -- Script stuff here end end)
Ad

Answer this question