local tweenInfo = TweenInfo.new(1)
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)
if player:GetRankInGroup(6856058) >= 255 then
prompt.Triggered:Connect(function()
if prompt.ActionText == “Close” then
tweenClose:Play()
prompt.ActionText = “Open”
else
tweenOpen:Play()
prompt.ActionText = “Close”
end
end)
end
@HappyC0der is correct. Place the if-statement with GetRankInGroup in the Triggered function. It is asking for the parameter which is who triggered the proximity prompt. Therefore…
…rewrite this section as:
prompt.Triggered:Connect(function(player)
if player:IsInGroup(6856058) then
if prompt.ActionText == “Close” then
tweenClose:Play()
prompt.ActionText = “Open”
else
tweenOpen:Play()
prompt.ActionText = “Close”
end
else
print(“Join the group next time you come here!”)
end
end)
If it’s a group only door, use IsInGroup() instead. Or is there a reason you used GetRankInGroup()?