How does UserInputService work? (I tried)
Asked by
asgm 109
5 years ago
So.., I did this after 3 hours failing to do Mouse.Button1Down and Button1Up.
I thought it would solve my problem ...
01 | UserInputService = game:GetService( "UserInputService" ) |
02 | ChargeTime = script.Parent.Configurations.ArrowCharge.Value |
03 | FireEvent = game:GetService( "ReplicatedStorage" ).BowEvents.FireEvent |
05 | local ReloadTime = script.Parent.Configurations.ArrowReload.Value |
06 | local mouse = game.Players:GetPlayerFromCharacter(script.Parent.Parent):GetMouse() |
09 | holdDown = script.Parent.holdDown.Value |
12 | while UserInputService:IsMouseButtonPressed() = = true do |
16 | if UserInputService:IsMouseButtonPressed() = = false then |
21 | if UserInputService.InputBegan = = Enum.KeyCode.ButtonL 1 then |
It's a charging script for a bow.
(It's a local script)
What's the problem or is there any workaround?