So I have been recently trying to make a click detector that make a part become semi transparent only for a group. I am able to do this for everyone but not for just a group. I tried this:
local player = game.Players.LocalPlayer
local groupId = 3793549
function test()
if player:IsInGroup(groupId) then
game.Workspace.Part.CanCollide = false
game.Workspace.Part.Transparency = 0.5
wait(3)
game.Workspace.Part.CanCollide = true
game.Workspace.Part.Transparency = 0
end
end
game.Workspace.Part.ClickDetector.MouseClick:Connect(test)
I put the script in game.StarterPlayer.StarterPlayerScripts . Any advice? Also the script needs to affect everyone. It just needs to activate only from group members.

1 comment
playerAdded instead of localplayer in a regular script inside the block maybe???