Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make an animation when you enter a door like MeepCity?

I'm trying to get an animation when you enter in or out a door, maybe it could be white. Just think of MeepCity, for example. I just wanna know how to do that. Like what type of script it is or what script it says. This is optonal, you dont have to help me. THanks!

2 comments

0

optional*

0

Why are you playing that ODer infeste game anyways

1 answer

✓ Accepted answer

Local Script Example

local player = game.Players.LocalPlayer
repeat wait() until player.Character ~= nil and workspace:FindFirstChild(player.Name) ~= nil
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://0" -- Animation Id
local animTrack = humanoid:LoadAnimation(animation)
animTrack.Looped = true -- Optional, makes animation continue playing until Stopped

local debounce = true

workspace.Door.Touched:Connect(function(hit)
if debounce == false then return end
debounce = false
	animTrack:Play()
	wait(2) -- Default Time for Animations
	animTrack:Stop()
debounce = true
end)

Server Script Example

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://0"

local debounce = true

workspace.Door.Touched:Connect(function(hit)
if debounce == false then return end
debounce = false
	local humanoid = hit.Parent:WaitForChild("Humanoid")
	local animTrack = humanoid:LoadAnimation(animation)
	animTrack.Looped = true

	animTrack:Play()
	wait(2)
	animTrack:Stop()
debounce = true
end)

These just take a .Touched() Event and then activate when touching the workspace.Door

Animations must be made by the owner of the game for them to work, so you cannot use ones from the library or other players unless they were made by ROBLOX

This discussion is preserved as it was. New answers, comments, and votes are closed.