Keep getting IsInGroup a nill value heres the code, are you able to tell what i'm doing wrong? I was able to get it to work with hit but the type of game i'm making requires to it be click...
local rank = 1
local groupID = 4857556
clicked = false
waited = true
function onClicked(Clicker)
print(Clicker.Name)
if (Clicker.Name:IsInGroup(groupID) and Clicker.Name:GetRankInGroup(rank) >= rank) then
if clicked == true and waited == true
then
script.Parent.Transparency = 0
script.Parent.CanCollide = true
clicked = false
print("Clicked Close")
wait(0.1)
waited = false
end
if clicked == false and waited == true
then
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
clicked = true
end
wait(0.1)
waited = true
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 comment
Error is on line 25 other parts work already.