IsInGroup:() Not Working

local GroupFrame = script.Parent.Parent.GroupFrame
local Players = game:GetService("Players")
local GroupID = 33662799

Players.PlayerAdded:Connect(function(player)
	local InGroup = player:IsInGroup(GroupID)
	if InGroup then
		print("InGroup")
		script.Parent.Visible = false
	else
		script.Parent.Visible = true
	end
end)

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.GroupFrame.Visible = not script.Parent.Parent.GroupFrame.Visible
end)


I have tried many things, it wont work, pls help
Its a LocalScript

2 Likes

I know you’ve said that u already tried a bunch but make sure it’s the right group

Nvm it is I just put roblox.com/groups/33662799

1 Like

Wait oh I didn’t notice, maybe try getting the player with game.Players.LocalPlayer instead of using the PlayerAdded event

1 Like

can you give me more detail? im confused

1 Like

Like do this:

local Player = game.Players.LocalPlayer

I’m not sure if PlayerAdded works on LocalScripts

1 Like

I fixed the script myself, sorry for late reply

1 Like

you need to test it in game, not in studio, and it probably need server side, but i don’t know

By the way you should make your post the solution

--33662799
local InGroup = game.Players.LocalPlayer:IsInGroup(33662799)
local Players = game:GetService('Players')

if InGroup then
	script.Parent.Visible = false
	local clone = game.ReplicatedStorage.GroupSword:Clone()
	clone.Parent = game.Players.LocalPlayer.Backpack
	print("CLONED!")
end

Code I used, thanks for helping

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.