Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

UserinputService does not work properly, any solutions ?

Asked by 4 years ago

So, basically this script was supposed to work i assume, the script should've run something every time i hold my mouse's left button and then stop when i release it, but instead when i click once it just runs without stopping, but if you hold it a little longer, it works fine, i don't understand why isn't it working, i hope you can help me.

01tool.Equipped:Connect(function()
02    game.ReplicatedStorage.Equip:FireServer()
04    TextLabel.Visible = true
05 
06    UIS.InputBegan:Connect(function(input)
07        if input.UserInputType == Enum.UserInputType.MouseButton1 then
08            pressed = true 
09            while pressed and tool.Equipped do         
10                if Ammo1 <= 0 then
11                    pressed = false
12                else
13                    Ammo1 = Ammo1 - 1
14                    tool.GunShot:Play()
15                    if mouse.Target.Parent:FindFirstChild("Humanoid") then
View all 29 lines...
0
I think in the line 30 the "if" needs a "end" PepeElToro41 132 — 4y
0
Wait a minute, all the "if" need a a end .-. PepeElToro41 132 — 4y
0
i just didnt include the ends Random_Haxer5 10 — 4y

Answer this question