What do you want to achieve? Keep it simple and clear! Im trying to make a Q ability for my game
What is the issue? Include screenshots / videos if possible! When i press It doesnt work when pressing Q, even added print.
What solutions have you tried so far? Did you look for solutions on the Developer Hub? None
its in a local script also
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local deb = false
local player = Players.LocalPlayer
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if player.Character:FindFirstChild("Attack") then
if input.UserInputType == Enum.UserInputType.MouseButton1 and not gameProcessed then
player.Character.Attack:FireServer()
end
if player.Character:FindFirstChild("AbilityQ") then
if input.UserInputType == Enum.KeyCode.Q and not gameProcessed then
player.Character.AbilityQ:FireServer()
end
end
end
end)
Put the event in a different place other than the character and it should work. The character is controlled in the Client. So it probably wont work because of that. Let me know if it doesn’t work and I’ll help you troubleshoot the issue.
I made it look like:
if player.Character:FindFirstChild(“AbilityQ”) then
if input.KeyCode == Enum.KeyCode.Q and not gameProcessed then
print(“yo”)
player.Character.AbilityQ:FireServer()
end
now it works, thank you