generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Question

Previous Thread :: Next Thread 
TheRobloxRambo is not online. TheRobloxRambo
Joined: 15 Aug 2013
Total Posts: 13
19 Aug 2013 02:26 PM
I'm trying to learn to script but it's just not working I just wont understand a thing from the wiki.
Well I understand a couple of things but not what I want to learn, I want to learn how to use onKeydown functions etc, and connect them with gui's, does anyone have any idea where or how I could learn it?
Help appriciated!

(I'm not English btw, I'm French and Dutch)
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
19 Aug 2013 02:27 PM
Been there done that.
Example:
function userInput()

local playert = game.Players.LocalPlayer
local mouse = playert:GetMouse()
local move = playert.PlayerGui.Main.Level.Player
local KeyPress
local Keys = {["w"] = true , ["a"] = true, ["s"] = true, ["d"] = true}
mouse.KeyDown:connect(function(key)
KeyPress = true
while KeyPress and Keys[key] and Wait(0.1) do
if key:lower() == "w" then
move.Position = move.Position + UDim2.new(0, 0, 0, -16)
elseif key:lower() == "s" then
move.Position = move.Position + UDim2.new(0, 0, 0, 16)
elseif key:lower() == "a"then
move.Position = move.Position + UDim2.new(0, -16, 0, 0)
elseif key:lower() == "d" then
move.Position = move.Position + UDim2.new(0, 16, 0, 0)

end
end
end)

mouse.KeyUp:connect(function(key)
if Keys[key] then
KeyPress = false
end
end)
end

You're welcome :)
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
19 Aug 2013 02:29 PM
Here is the full script.

http://www.roblox.com/free-item?id=127072609
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
19 Aug 2013 02:29 PM
I made it myself
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image