yea im trying to make a dance menu but for some reason the NPC doesnt play the animation when i hover over the button when its suppose to.
I have tried making the animation as a new instance and placing in the NPC but doesnt work.
local DancePreviewCharacter = script.Parent.Parent.Parent.DancePreview.ViewportFrame.R6
local button = script.Parentlocal player = game.Players.LocalPlayer
local character = player.Characterrepeat wait()
character = player.Character
until characterlocal dance = character.Humanoid:LoadAnimation(script.Parent.Animation)
local previewanimation = script.Parent.Animation:Clone()
previewanimation.Parent = DancePreviewCharacterlocal previewdance = DancePreviewCharacter.Humanoid:LoadAnimation(previewanimation)
local isDancing = false
button.MouseButton1Click:Connect(function()
if isDancing == false then
dance:Play()
isDancing = true
else
dance:Stop()
isDancing = false
end
end)button.MouseEnter:Connect(function()
print(“press played”)
previewdance:Play()
end)button.MouseLeave:Connect(function()
previewdance:Stop()
end)