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: KeyDown HELP!

Previous Thread :: Next Thread 
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:18 AM
Okay so let's say you have a skill that makes you go invisible by pressing e then
you have a text box and once you change that text box's text to r the skill that makes you go invisible changes to r and it's not e any more. I need a script to do that and yes I know no one script for people here so i'm asking for the part of the script where you change the text and it makes the ability what ever you want it to just a little part or if some one is willing to help me with the whole script that would be great.

~~All Memories Will Be Lost In Time~~
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 03:28 AM
SLOW DOWN
Speak english!
Wtf man!

plr = game.Players.LocalPlayer
mouse = plr:GetMouse()

mouse.KeyDown:connect(function(key)
if key == "a" then --let's say its a for now
plr.PlayerGui.ScreenGui.TextLabel.Text = "a"
end
end)

mouse.KeyUp:connect(function(key)
if key == "a" then --again,assuming the key is "a"
plr.PlayerGui.ScreenGui.TextLabel.Text = "b"
end
end)
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:30 AM
Oh hey man it's you again you're a nice person I like you can we be friends best friends cough cough my own private scripter of epicness cough cough. Lol jk let me see if I can work with this script. xD
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:38 AM
Oh I see what you're doing this is what I wanted I basicly wanted it to where if you went TO the text box and changed it yourself the key in the script would change. but I could probably edit some stuff around.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 03:39 AM
if key == plr.PlayerGui.ScreenGui.TextBox.Text then

:p
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 03:42 AM
Wait,using what I just posted will error if its more than 1..

Gui = plr.PlayerGui
Sg = Gui.ScreenGui
Tb = Sg.TextLabel

if string.len(Tb.Text) == 1 and tostring(Tb.Text) or tonumber(Tb.Text) then--not sure
if key == Tb.Text then
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:48 AM
Lol I was just doing something myself I should have checked this sooner okay let me see if that works.
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:54 AM
Should it look something like this so far?


plr = game.Players.LocalPlayer
Gui = plr.PlayerGui
Sg = Gui.Skills.HD1.HD2.Mframe.Functions.AstralBind
Tb = Sg.Skill1

mouse = plr:GetMouse()

mouse.KeyDown:connect(function(key)
if key == "a" then --let's say its a for now
plr.PlayerGui.ScreenGui.TextLabel.Text = "a"
end
end)

mouse.KeyUp:connect(function(key)
if key == "a" then --again,assuming the key is "a"
plr.PlayerGui.ScreenGui.TextLabel.Text = "b"
end
end)

if string.len(Tb.Text) == 1 and tostring(Tb.Text) or tonumber(Tb.Text) then--not sure
if key == Tb.Text then
end
end


Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:56 AM
My bad like this?


plr = game.Players.LocalPlayer
Gui = plr.PlayerGui
Sg = Gui.Skills.HD1.HD2.Mframe.Functions.AstralBind
Tb = Sg.Skill1

mouse = plr:GetMouse()

mouse.KeyDown:connect(function(key)
if key == "a" then
end
end)


if string.len(Tb.Text) == 1 and tostring(Tb.Text) or tonumber(Tb.Text) then--not sure
if key == Tb.Text then
end
end


Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 04:10 AM
Right under the
If key == "a"
Move the two ends to the very bottom
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 04:12 AM
Take out if key == "a"
And remove one end
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 04:16 AM
And what should I change the text to 1?
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 04:18 AM
Your not making sence
Just do as I posted,it already checks what the key is
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 04:18 AM
Well it's not working this is what I have so far.

plr = game.Players.LocalPlayer
Gui = plr.PlayerGui
Sg = Gui.Skills.HD1.HD2.Mframe.Functions.AstralBind
Tb = Sg.Skill1

mouse = plr:GetMouse()
mouse.KeyDown:connect(function(key)
if key == "" then

if string.len(Tb.Text) == 1 and tostring(Tb.Text) or tonumber(Tb.Text) then--not sure
if key == Tb.Text then
end
end
end
end)
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 04:19 AM
Oh hold on I think I see the problem.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 04:20 AM
Take
Out
The
Entire
Line
That
Says
if key == ""--REMOVE THIS LINE,GET RID OF IT

And then remove an end
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 04:24 AM
Ya that's what I seen but still doesn't work

plr = game.Players.LocalPlayer
Gui = plr.PlayerGui
Sg = Gui.Skills.HD1.HD2.Mframe.Functions.AstralBind
Tb = Sg.Skill1

mouse = plr:GetMouse()
mouse.KeyDown:connect(function(key)
if string.len(Tb.Text) == 1 and tostring(Tb.Text) or tonumber(Tb.Text) then--not sure
if key == Tb.Text then
print("WORKS!")
end
end
end)
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 04:48 AM
Bump
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 05:06 AM
Ok,change the entire function to this:


mouse.KeyDown:connect(function(key)
ypcall(if key == Tl.Text then print "yay!")
end)

Ypcall should make sure it doesn't error,if it does,it'll continue still
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 05:07 AM
Oop,meant "Tb.Text"
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:05 PM
That has the red line under it and I tried fixing it but can't I canged ypcall to pcall and changed the other thing to Tb but it still has a red line under it.
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:11 PM
Oh okay it will make sure it doesn't error ._.
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:13 PM
Still doesn't work.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Mar 2014 03:15 PM
Change this line
ypcall(if key == Tb.Text then print "yay")
To

ypcall(if key == Tb.Text then print "yay" end)--I forgot an end
Report Abuse
zerogravity1014 is not online. zerogravity1014
Joined: 08 Apr 2010
Total Posts: 436
20 Mar 2014 03:18 PM
plr = game.Players.LocalPlayer
Gui = plr.PlayerGui
Sg = Gui.Skills.HD1.HD2.Mframe.Functions.AstralBind
Tb = Sg.Skill1

mouse = plr:GetMouse()
mouse.KeyDown:connect(function(key)
ypcall(if key == Tb.Text then print "yay!")
end
end)
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