I will explain my script briefly. This script is normal script. It is located in the door. The door has a "Handle" with a click detector in it. This is not the point. Let's move on to the second part of the script. The script detects if the player is in the team. If so, the door stops. is de-anchored and the player has to play the animation, the problem is that the animation does not work.
To help you troubleshoot the problem, this is the only error underlined in yellow on the console. " ? Infinite yield possible on 'Workspace.KotyOceloty:WaitForChild("humanoid")' (x2) - Studio"
function Open(player) if player.Team == game.Teams["DOR Members"] then if opened == false then opened = true for i = 1, 10 do script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(9), 0)) wait() end else opened = false for i = 1, 10 do script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(-9), 0)) wait() end end end if player.Team == game.Teams.Interpol then local copy = game.ReplicatedStorage.Door:Clone() local remain = game.ReplicatedStorage.CopyDoor:Clone() --animation script start local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID="..8293367949 --here the console shows I have a problem.(down) local loadedAnimation = game.Workspace[player.Name].Humanoid:LoadAnimation(animation) game.Workspace["Fbi open up"]:Play() wait(2.011) loadedAnimation:Play() --play animation wait(0.5) script.Parent:Destroy() remain.Parent = game.Workspace remain.Anchored = false --makes door fall from upstairs and plays sound game.Workspace["Wood Breaking"]:Play() end end
if someone still does not understand, it has what interests me written in the script. I am asking for a quick answer.
There is a possibility that there is more than one model named as your Username, and in my opinion, there is also a better way to get the player's character and is from player.Character.
So your line would look like this:
Player.Character:FindFirstChild('Humanoid'):LoadAnimation(animation)