So uh, I've been trying to make this script work for some time now with the UserInputService yet I still can't manage to find the solution. I am fairly new to this, so help would be appreciated.
local Player = game.Players.LocalPlayer
local anim1 = Instance.new("Animation")
anim1.AnimationId = "http://roblox.com/Assets?ID=2294643345"
UIS = game:GetService("UserInputService")
UIS.InputBegan:connect(function(key)
if key.KeyCode == Enum.KeyCode.Q then
print("Pressed!")
local Fire1 = Instance.new("Fire", Player.Character.LeftHand)
Fire1.Color = Color3.new(236, 139, 70)
Fire1.SecondaryColor = Color3.new(255, 0, 0)
Fire1.Heat = -20
Fire1.Size = 4
local Fire2 = Instance.new("Fire", Player.Character.RightHand)
Fire2.Color = Color3.new(236, 139, 70)
Fire2.SecondaryColor = Color3.new(255, 0, 0)
Fire2.Heat = -20
Fire2.Size = 4
local animation1 = Player.Character.Humanoid:LoadAnimation(anim1)
animation1:Play()
wait(3)
Fire1:destroy()
Fire2:destroy()
end
end)
I am pretty sure the script doesn't go past the
function onKeyPress(inputObject, gameprocessed)
if inputObject.KeyCode == Enum.KeyCode.Q then
part.
Thank you.

3 comments
Is it a localscript? and where is the script located
It is a localscript, and it's just located in workspace.
then it wont work, put the local script in starterplayer scripts