So I've been doing some tests with scripts and stuff to make a Jetpack that goes upward when you hold down SpaceBar.
v Here's my unfinished script v
db = true
script.Parent.Touched:connect(function(h)
human = h.Parent:FindFirstChild("Humanoid")
torso = h.Parent:FindFirstChild("Torso")
if human ~= nil then
if torso ~= nil then
if db == true then
db = false
local upward = Instance.new("BodyForce", torso)
upward.Name = "Y_Acess"
-- Possible function to have in here that detects when or if space was held down?
upward.Force = Vector3.new(0, 2100, 0)
-- and elseif it wasn't being pressed or help down it would go to
--upward.Force = Vector3.new(0, 0, 0)
end -- db
wait(10000)
db = true
end
end
end)
Hopefully, there should be a type of way to do this because I've used keyboard input functions before, but it was in a LocalScript.
Could somebody tell me if there's any possible way to have a keyboard input in a regular Script and not a LocalScript?
Thanks, -jack8699

6 comments
Is that supposed to work in a regular script in workspace, or in a LocalScript? I tried doing that in the regular script and nothing happened.
LocalScript
Any possible way to have it happen in a regular script?
No, UserInputService is client-side only. http://wiki.roblox.com/index.php?title=Userinputservice
Thanks.
You can see tho when the humanoid jumped but thats it