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

How do i make a charging effect?STILL HAVE QUESTIONS]

Asked by 9 years ago
wait(0.01)
local enabled = true
Player = game.Players.LocalPlayer
character = Player.Character
mouse = Player:GetMouse()
run = game:GetService("RunService")
Humanoid = Player.Character.Humanoid
Nen = Player.Nen

function Charging(key)
    key = key:lower()
    if key == "0" then
        if Nen.Value <= 100 then
            Nen.Value = Nen.Value +1
        end
    end
end

mouse.KeyDown:connect(Charging)

If i hold left shift how do i make it go up by 1 every second that i hold shift down?

1 answer

Log in to vote
0
Answered by 9 years ago
mouse.KeyDown:connect(function(key)
    keysDown[key:lower()] = true
end)

mouse.KeyUp:connect(function(key)
    keysDown[key:lower()] = false
end)

use this to let the script know when you're not holding shift down

How to add +1


while wait(.1) do if Nen.Value <= 100 then Nen.Value = Nen.Value +1 end end
0
Yeah but,how do i make the number value go up by 1 every 0.1? kingalpha1 15 — 9y
0
You need a while true loop, here. Ill edit. Orlando777 315 — 9y
0
Players.kingalpha1.Backpack.Charge:23: attempt to index global 'keysDown' (a nil value) kingalpha1 15 — 9y
Ad

Answer this question