Okay i'd say i'm a 2/10 scripter and i've been working on this on and off and I feel like i'm doing something wrong. It's supposed to be a Run script, if you hold shift the bar goes down..you release it charges. Simple right? After I urged myself to not go to this site to ask for help for the past 2 days on previous versions of this script I finally gave in. 1 You can exploit the charge by spamming shift and 2 I feel like it could be simplified If anyone can help and 3 It seems the health script (that's in the game) works fine on multiplayer but this run script only works instudio, can someone explain that too I'm really confused please click on my name and go to my profile I made the game uncopylocked so you can look at the script in depth if you have too
MyMouse = game.Players.localPlayer:GetMouse()
Player = game.Players.localPlayer
local xSize = script.Value.Value
local speed = 0.01
local human = script.Parent.Parent.Parent.Parent.Character.Humanoid
--local human = Player.Character:FindFirstChild("Humanoid")
--script.Parent.Parent.Parent.Parent.Character.Humanoid
MyMouse.KeyDown:connect(function(key)
if (key:byte() == 48) then
while script.Bool.Value == true do
if xSize > 0.01 then
script.Bool.Value = true
human.WalkSpeed = 100
for i = 1,1 do
xSize = xSize - speed
wait()
script.Parent.Bar.Size = UDim2.new(xSize,0,1,0)
end
end
if xSize <= 0.01 then
human.WalkSpeed = 16
script.Bool.Value = false
end
end
end
end)
MyMouse.KeyUp:connect(function(key)
if (key:byte() == 48) then
human.WalkSpeed = 16
script.Bool.Value = false
while script.Bool.Value == false do
if xSize < 1 then
for i = 1,1 do
xSize = xSize + speed
wait()
script.Parent.Bar.Size = UDim2.new(xSize,0,1,0)
end
else
wait()
script.Bool.Value = true
end
end
end
end)

1 comment
Is the key "48" the left shift key? Also, I believe Lua is case-sensitive, and you have "localPlayer" instead of "LocalPlayer". Is there anything in your output?