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

Why is my charging script breaking when it passes below 30?

Asked by
rexpex 45
8 years ago

i tried to make a script that reduces energy when you attack. I made it decreases if 30 and stops if the player has below 30 energy;but, when the energy goes below 30 it makes players not attack anymore, why?

01tool = script.Parent
02PunchEvent = game.Workspace.Attacks["Rico's Attacks"].Punch
03replicatedstorage = game:GetService("ReplicatedStorage")
04staticball = replicatedstorage.RicoClass:findFirstChild("Lightning")
05cooldown = false
06 
07 
08 
09tool.Selected:connect(function(mouse)
10mouse.Button1Down:connect(function()
11 
12if not cooldown then
13    cooldown = true
14    local player = game.Players.LocalPlayer
15 
View all 39 lines...
0
Try explaining this question a little more. I'm a bit confused when trying to help, it's not attacking when it's below 30 because the script says if energy.Value >= 30 so if it's 29 this obviously wont run, however, I don't think this is what you are asking. harryisbeast 70 — 8y
0
I am confused. Please try explaining a little more. It sounds like you have this script that stops players from attacking when their energy is below 30, but then it seems the players can't attack when their energy is below 30? nobo404 17 — 8y

1 answer

Log in to vote
0
Answered by
rexpex 45
8 years ago

nvm i solved the problem

Ad

Answer this question