Hello, I have a problem with the script and I don't know why it doesn't work. Here's the script.

local GroupID = 14223507
local MinimumRank = 253
local Door = game.Workspace.Door

local TweenService = game:GetService("TweenService")

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(Message)
		if Player:GetRankInGroup(GroupId) >= MinimumRank then
			if Message == "!OpenDoor" then
				local DoorTween = TweenService:Create(Door, TweenInfo.new(1), {Orientation  = Door.Orientation + Vector3.new(0, Door.Orientation.Y, 90)})
				DoorTween:Play()
			elseif Message == "!CloseDoor" then
				local DoorTween = TweenService:Create(Door, TweenInfo.new(1), {Orientation = Door.Orientation - Vector3.new(0, Door.Orientation.Y, 90)})
				DoorTween:Play()
			end
		end
	end)
end)

2 comments

0

Do you have a problem with closing or opening the door?

0

Open and close. All isn’t working