Me and my friend are working on a game. It's magic themed and one of the things are wands - I'm trying to script it but it doesn't seem to do anything. For this script, I am making a function where when you press Q on your keyboard while you have your wand equipped, you do a block animation and block any incoming spells (for now it just prints to check if everything is working). When I run it, it does not work. No errors are in console, but nothing happens, it doesn't print anything.
Script:
local enabled = false
local uis = game:GetService("UserInputService")
--variables
script.Parent.Parent.Equipped:Connect(function()
enabled = true
end)
script.Parent.Parent.Unequipped:Connect(function()
enabled = false
end)
--yanno
uis.InputEnded:Connect(function(input)
if input == Enum.KeyCode.Q and enabled == true then
print("working")
end
end)
