Ad
Log in to vote
0

Script decide to stop working? and i do not know why!

Asked by 2 days ago
Edited 2 days ago

Hello when i tested my game yesterday evrything worked but today i tested it and it does not work i didn't change anything about it

Here are the scripts that do not work the first makes the door swing and the other one is to play a animation

local TweenService = game:GetService("TweenService")

local door = workspace.Door
local doorRoot = door.PrimaryPart

local DoorSwingInfo = TweenInfo.new(0.2)

local DoorSwingTween = TweenService:Create(doorRoot, DoorSwingInfo, {
    CFrame = doorRoot.CFrame * CFrame.Angles(0,math.rad(-80), 0)
})
script.OPENUP.TimePosition = 0.4
game.Workspace.House.DoorHandle.ProximityPrompt.Triggered:Connect(function()
    wait(2)
    game.Workspace.Value.Value = 1
    script.OPENUP.Playing = true    
    DoorSwingTween:Play()
end)

--------------------------------------------------------------------Script barrier

local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://6422157733"

local controller = script.Parent.Humanoid -- path to Humanoid/AnimationController

game.Workspace.House.DoorHandle.ProximityPrompt.Triggered:Connect(function()
    wait(2.5)
    controller:LoadAnimation(anim):Play()
    wait(4.2)
    script.Parent:Destroy()
end)

Does any one have a solution?

0
any errors? jerryisgod29 131 — 2d
0
No datboyPiter 4 — 2d
0
jerryisgod29 No datboyPiter 4 — 2d
0
Have you tried play testing it in roblox, instead of roblox studio? Azure_Kite 855 — 2d
0
yes datboyPiter 4 — 2d

1 answer

Log in to vote
0
Answered by 2 days ago

Roblox has deprecated the function Humanoid:LoadAnimation. For the variable controller, use script.Parent.Humanoid:WaitForChild("Animator") instead of script.Parent.Humanoid. Also, check if all the paths still exist.

0
well thats half of my questions so ill wait and then give an accept ok becouse i still need a fix for the door datboyPiter 4 — 2d
Ad

Answer this question