Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

My punching animation only works in studio may anyone help? I think it has something to do with

Asked by 9 days ago
Edited 9 days ago

local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse()

Here is the full script though:~~~~~~~~~~~~~~~~~

local Player = game.Players.LocalPlayer`local Mouse = Player:GetMouse() local dmg = true Mouse.KeyDown:connect(function(key) if key == "f" then local an = script.Parent.Humanoid:LoadAnimation(script.Animation) an:Play() script.Parent.RightHand.Touched:connect(function(hit) if hit.Parent.Humanoid and dmg == true then hit.Parent.Humanoid:TakeDamage(20) dmg = false wait(1) dmg = true end end) end end)

0
Please format your code correctly, the code should be within those 2 lines of symbols JeffTheEpicRobloxian 142 — 9d
0
okay PizzaManLoverBoiNoah 0 — 9d
0
I said it will work in studio, it wont work on servers. PizzaManLoverBoiNoah 0 — 9d

1 answer

Log in to vote
0
Answered by 9 days ago

It wont work in studio because key down is deprecated, UserInput Service is probably what you should be using

Ad

Answer this question