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

How to Get A GUI/Jump Script to Work?

Asked by 9 years ago

Hello. I have been working on this script for a very long time, and it is easily exploitable. Can someone help me fix it? I think there has to be an activation or something in there, but I just don't know. Here is the script:

local player = game.Players.LocalPlayer
local refresh = Instance.new("BoolValue")
local mouse = player:GetMouse()
refresh.Parent = player
refresh.Value = false
print(refresh.Value)
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
local TextLabel = Instance.new("TextButton")
TextLabel.Parent = screenGui
TextLabel.Position = UDim2.new(0, 700, 0, 310)
TextLabel.Size = UDim2.new(0, 150, 0, 50)
TextLabel.BackgroundColor3 = BrickColor.Red().Color
TextLabel.Text = "Jump Restarting..."
function onSpace(key)
    if key == "e" and refresh.Value == true then
        player.Character.Humanoid.JumpPower = 150
        player.Character.Humanoid.Jump = true       
        refresh.Value = false
        TextLabel.BackgroundColor3 = BrickColor.Red().Color
        TextLabel.Text = "Jump Restarting..."           
    end
    if refresh.Value == false then
        wait(5)
        refresh.Value = true
        TextLabel.BackgroundColor3 = BrickColor.Green().Color
        TextLabel.Text = "Jump is ready."
    end
end
mouse.KeyDown:connect(onSpace)

Thanks for reading and looking through!

Answer this question