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

How do I start an animation when i click on a tool?

Asked by 2 years ago

So, i'm trying to start an player animation when I click. I'm new to scripting so i really don't understand what wrong. I've tried using


script.Parent.MouseButton1Down:Connect(Function() --some code here i forgot what it was end)

but that doesn't work. Please help.

0
use remote events. bossshot1234 17 — 2y
0
sorry for ths spam but this is what i mean bossshot1234 17 — 2y
0
@bossshot1234 You do not need to use RemoteEvents for playing animations as you can play animations on the client. | @OP Did you receive any errors in the Output window? COUNTYL1MITS 312 — 2y
0
yes but it would not show i am pretty sure, since thats only the client? bossshot1234 17 — 2y
0
and if he wanted to make something happen with a marker signal he would need a server script. bossshot1234 17 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

script.Parent.MouseButton1Down:Connect(function() -- this is in a local script inside of the tool game.Replicated Storage.RemoteEvent:FireServer()-- or whatever the name and the parent end

-- now, in the script in server script service

game.Repstrg.RemotEvent.Onserverevent:Connect(function(player) local anim = -- wherever ur animation is local animator = instance.new("Animator", player.Character.Huamnoid) local track = animator:LoadAnimation(anim)

track:Play()

end

0
ahh thats a really messed up layout, but the whole thing is the script bossshot1234 17 — 2y
Ad

Answer this question