RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"can you give it like an animation to like opening and closing"
-- sure, here's a server script for opening and closing a door with an animation local door = game.Workspace.Door local openAnim = Instance.new("Animation") openAnim.AnimationId = "rbxassetid://YourOpenAnimationIDHere" local closeAnim = Instance.new("Animation") closeAnim.AnimationId = "rbxassetid://YourCloseAnimationIDHere" local openAnimTrack = door:LoadAnimation(openAnim) local closeAnimTrack = door:LoadAnimation(closeAnim) local isOpen = false function openDoor() if not isOpen then openAnimTrack:Play() isOpen = true end end function closeDoor() if isOpen then closeAnimTrack:Play() isOpen = false end end door.Touched:Connect(function(otherPart) if otherPart.Parent:FindFirstChild("Humanoid") then if isOpen then closeDoor() else openDoor() end end end)