I basically have this script where whenever a player jumps, it'll toggle some text on the top of the screen. It'll say "Jump when you are ready" then when someone jumps, it'll toggle "Shoot!". Basically, it'll give someone an idea when to release the tool after a given number of seconds.
Here's the script, it basically deals with humanoids and their jump functions.
Local Script
local player = game.Players.LocalPlayer
local character = player.Character
repeat wait() until character
humanoid = character:WaitForChild("Humanoid")
local label = script.Parent
local debounce = true
local playergui = player:WaitForChild("PlayerGui")
local lukemode = playergui:WaitForChild("LukeMode")
local value = lukemode:WaitForChild("Value")
humanoid.Changed:connect(function()
if humanoid.Jump == true then
if debounce then
debounce = false
if value.Value == true then
wait(0.2)
else
wait(0.35)
end
label.Text = "Shoot!"
wait(1)
label.Text = "Cooldown.."
debounce = true
wait(1)
label.Text = "Jump when you are ready."
end
end
end)
Now this doesn't work when it's in server-side, which I tried to attempt down below.
Attempted Server Side:
local debounce = true
function onTouched(hit)
if hit.Name == "VBL_Ball" or hit.Parent:IsA("Tool") then
wait()
else
local character = hit.Parent
print("character found")
local player = game.Players:GetPlayerFromCharacter(character)
print("player found")
local humanoid = character:WaitForChild("Humanoid")
print("humanoid found")
local gui = player:WaitForChild("PlayerGui")
print("gui found")
local screen = gui:WaitForChild("ScreenGui")
print("screen found")
local frame = screen:WaitForChild("Frame")
print("frame found")
local label = frame:WaitForChild("TextLabel")
print("label found")
local lukemode = gui:WaitForChild("LukeMode")
print("lukemode found")
local value = lukemode:WaitForChild("Value")
print("value found")
humanoid.Changed:connect(function()
print("humanoid changed")
humanoid.Jumping:connect(function()
print("humanoid jumping")
if humanoid.Jump == true then
print("humanoid jump")
if debounce then
debounce = false
if value.Value == true then
wait(0.2)
else
wait(0.35)
end
label.Text = "Shoot!"
wait(1)
label.Text = "Cooldown.."
debounce = true
wait(1)
label.Text = "Jump when you are ready."
end
end
end)
end)
end
end
script.Parent.Touched:connect(onTouched)
What's Suppose to Happen in the End (Only works in Client):
Hopefully you guys can figure out a solution to my problem.
Sincerely,
LukeGabrieI

3 comments
You're not supposed to be using ServerScripts in StarterGui. Why would you want to convert it to a ServerScript anyway, it works fine as-is.
Yeah but I want the GUI to pop up while the player jumps lol
I found it easier to use this: http://wiki.roblox.com/index.php?title=API:Class/UserInputService/JumpRequest