Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make click detector script that will run animation into player when its clicked? [closed]

Asked by 5 years ago
Edited by DeceptiveCaster 5 years ago

I am working on it a few days but I can't make it work. I need help since I am new to Lua. I am trying to create an animation that will play when click detector is clicked. So I just wanted to ask if someone knows how to run animation when a player clicks a click detector. Here is my script I was working on:

local click = game.Workspace.Part.ClickDetector
local plr = game.Players.LocalPlayer
local hum = plr.Character.Humanoid
local animation = game.ReplicatedStorage.Animation
local anim_start = hum:LoadAnimation(animation)
current = anim_start
click.MouseClick:Connect(function()
    current:Play()
end)

I would be glad if someone can fix this script or rewrite it so it will work. Thank you anyways.

0
I put the code in a code block. DeceptiveCaster 3761 — 5y
0
Still more explanation needed, like output errors. Repost when you can ask a better question. User#24403 69 — 5y

Closed as Too Broad by User#24403

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?