RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Add a function where it plays the animation when i click a master part tell me how to set it up"
-- server script -- first, insert a ClickDetector into the master part local masterPart = game.Workspace.MasterPart local clickDetector = Instance.new("ClickDetector") clickDetector.Parent = masterPart -- next, load the animation into the humanoid local humanoid = game.Players.LocalPlayer.Character.Humanoid local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://YourAnimationIdHere" -- replace with your animation id local dance = humanoid:LoadAnimation(animation) -- finally, connect the click event to play the animation clickDetector.MouseClick:Connect(function(player) dance:Play() end)