Advanced Roblox Scripting Tutorial #6 - UserInputService (Beginner to Pro 2019)

  Рет қаралды 206,782

TheDevKing

TheDevKing

Күн бұрын

Пікірлер: 714
@TheDevKing
@TheDevKing 5 жыл бұрын
Hey guys! If you have any questions or just want to meet / connect with me and other roblox devs. Be sure to join the discord server! discord.gg/FKcSyRh
@NewsOnQueue
@NewsOnQueue 4 жыл бұрын
Enum is enumerated I think
@Random-v8k
@Random-v8k 4 жыл бұрын
I adore your backround on pc.
@wisewastaken
@wisewastaken 4 жыл бұрын
Im really confused on this topic
@Random-v8k
@Random-v8k 4 жыл бұрын
@@wisewastaken I can help you.
@pill0h130
@pill0h130 3 жыл бұрын
I kept getting an error saying that Keycode isnt a valid member of InputObject
@normaliscsatorna3130
@normaliscsatorna3130 5 жыл бұрын
No hotdogs in the video... *Impossible.*
@dragonmaster4548
@dragonmaster4548 5 жыл бұрын
lol
@ooney2182
@ooney2182 5 жыл бұрын
bruhh
@Drxvmik
@Drxvmik 4 жыл бұрын
now he has to do how to do hotdogs in real life using a lua script in roblox studio
@RandomInternetIdot
@RandomInternetIdot 4 жыл бұрын
Bruh
@siftanimationsandgaming5297
@siftanimationsandgaming5297 4 жыл бұрын
@@ooney2182 what
@littlemikey382
@littlemikey382 5 жыл бұрын
If you guys still don't understand what "Enum" does, it's kind of a list that holds properties.
@farzanaabdulaleem4217
@farzanaabdulaleem4217 4 жыл бұрын
Galaxy Realm enumeration like when the script doesn’t understand what thing ur saying write enum
@kepiblop
@kepiblop 4 жыл бұрын
@@farzanaabdulaleem4217 Buy me a hotdog Syntax error print("Buy me a hotdog") Buy me a hotdog enum.Purchase.Hotdog Ordering hotdog for $0.93
@farzanaabdulaleem4217
@farzanaabdulaleem4217 4 жыл бұрын
kepiblop kepiblop.reply(“GET ME A HOTDOG TOO”) End)
@kepiblop
@kepiblop 4 жыл бұрын
@@farzanaabdulaleem4217 Syntax error
@farzanaabdulaleem4217
@farzanaabdulaleem4217 4 жыл бұрын
kepiblop print(“why”)
@MadiTek
@MadiTek 5 жыл бұрын
This is why I love your videos, Scripting excites you that makes me excited and motivated to learn
@TheDevKing
@TheDevKing 5 жыл бұрын
Awesome! :D
@henrikedelauk3605
@henrikedelauk3605 4 жыл бұрын
Same
@wksoskskskkskzksk6341
@wksoskskskkskzksk6341 4 жыл бұрын
Same
@t-k4560
@t-k4560 4 жыл бұрын
Same
@colbyzav
@colbyzav 4 жыл бұрын
@@TheDevKing Are you cool
@deathstun1186
@deathstun1186 4 жыл бұрын
if you are still confused about what an Enum is, it's short for Enumerator and its basically a list of numbers where each number is saved to a name so you don't have to remember random numbers to get to the value you want.
@pigeonblox4994
@pigeonblox4994 2 жыл бұрын
Yeah it's basically a little collection of possible things, in this case, letters and keycodes
@CrimeWithEli
@CrimeWithEli Жыл бұрын
ASCII values?
@DustyBawls.
@DustyBawls. Жыл бұрын
Big ups for that ty
@michaelswahla4927
@michaelswahla4927 Жыл бұрын
what hes saying is u use variable to represent numbers PLAYERS = 6 so if i wanna represent num players i use PLAYERS instead of 6
@Nathanator
@Nathanator 5 жыл бұрын
Here’s a tip for everyone: The keys are based on the LOCATION of the key on a QWERTY keyboard, not the key. If you’re using an AZERTY, QWERTZ, Dvorak, or another keyboard, the key will be different. For example, a function mapped to the Q key will instead get run when A is pressed on an AZERTY keyboard.
@nanicoauau9720
@nanicoauau9720 5 жыл бұрын
Wow :0 thx
@Nathanator
@Nathanator 5 жыл бұрын
Wub :3 no problem!
@galaxyguy4247
@galaxyguy4247 4 жыл бұрын
W would be Z in AZERTY
@soronorjspro3516
@soronorjspro3516 4 жыл бұрын
Cool.
@SaxePrixon
@SaxePrixon 3 жыл бұрын
omfg now i consider quitting cuz of that
@XTCreationz420
@XTCreationz420 5 жыл бұрын
when his godlike scripting information can't contain itself inside his head 0:46
@davidkinzel3846
@davidkinzel3846 3 жыл бұрын
13:00 for putting the key name only (for example W instead Enum.KeyCode.W ) you put the following code print("You pressed "..input.KeyCode.Name) This could help for coding in the future depending on how you use it. Can you Pin this pls so people can see it. Thx
@xkrystalbrookex
@xkrystalbrookex 2 жыл бұрын
I would pin it if I could, that's really helpful. Thanks!
@meowmeow9617
@meowmeow9617 Жыл бұрын
It’s been 2 years and he didn’t pin it 😢
@davidkinzel3846
@davidkinzel3846 Жыл бұрын
@@meowmeow9617 :(
@SomeRandomBacon
@SomeRandomBacon 5 ай бұрын
@@meowmeow9617 3 years now
@emirparlar2616
@emirparlar2616 3 ай бұрын
ty for the idea I used it as a textlabel in startergui
@BG3SF
@BG3SF 2 жыл бұрын
13:15 you can still do print("player pressed key "..input.KeyCode) but you have to add a tostring() so it would be | print("player pressed key "..tostring(input.KeyCode))
@evilyxof
@evilyxof 8 ай бұрын
What I did was simply this: uis = game:GetService('UserInputService') uis.InputBegan:Connect(function(input, gameProcessedEvent) if input.UserInputType == Enum.UserInputType.Keyboard then print("Key Pressed: "..input.KeyCode.Name) end end)
@BG3SF
@BG3SF 8 ай бұрын
@@evilyxof bro only responded a year late 😭🙏
@lamedev1342
@lamedev1342 5 жыл бұрын
Awesome video man! You have really helped me in Roblox scripting and I'm so grateful to have come across you! Thank you so much!
@Hexaltra
@Hexaltra 5 жыл бұрын
Mee too 👏🏼
@TheDevKing
@TheDevKing 5 жыл бұрын
So glad I could help :) Be sure to check out some more videos lots of more tutorials coming soon :)
@magical1802
@magical1802 4 жыл бұрын
Also, Roblox recommends 'User Input Service' because it makes use of the mouse and keys both, and many more commands are contained within it.
@Milad1337xd
@Milad1337xd 5 ай бұрын
at 14:26 if you use a variable to make the part make sure to use waitforchild since the script already ran before the part loaded in so it will run it until the part loads in
@IX_4
@IX_4 4 жыл бұрын
14:07 I managed to delete my red part before you told me to, I'm proud of myself. Now, to sleep and forget everything lol..
@blendermyles
@blendermyles 3 жыл бұрын
Just script daily and mess around doing cool things and you will remember
@ThyBoiledOne
@ThyBoiledOne 3 жыл бұрын
@@blendermyles very genius. i made a game where theres random stuff and i mess around, i play with my friends cuz its very fun
@davvidns
@davvidns 2 жыл бұрын
Enum is a list that holds values. For example Enum.BrickColor would take all of the possible Brick colors. In this video it'd take all the keys
@davvidns
@davvidns Жыл бұрын
@Fractional no problem
@naminex4443
@naminex4443 Жыл бұрын
Thanks chief!
@davvidns
@davvidns Жыл бұрын
@@naminex4443 No problem
@ZxTsusYT
@ZxTsusYT Жыл бұрын
Only comment that makes actual sense, thank you so much
@davvidns
@davvidns Жыл бұрын
@@ZxTsusYT np bud
@arminius94
@arminius94 5 жыл бұрын
Hey man such a nice video! I'm learning scripting this much just because of you! Will you do DataStoreService and MarketPlaceService soon?
@thegood_soup
@thegood_soup 4 ай бұрын
wow, this is so cool... I was able to make a sprinting system with a stamina system that had a max limit. these truely are some of the best lua tutorials.
@Editmasterer
@Editmasterer 4 ай бұрын
Was this just from this video
@thegood_soup
@thegood_soup 4 ай бұрын
Pretty much
@Editmasterer
@Editmasterer 4 ай бұрын
@@thegood_soup cool hopefully I can too
@Editmasterer
@Editmasterer 4 ай бұрын
I cant create the stamina how
@thegood_soup
@thegood_soup 4 ай бұрын
@@Editmasterer it’s kinda hard but basically you make it so that when shift is pressed, a running value that you make is sent to true, when it’s true, use while loops to decrease a stamina value you make. Then when it hits zero change the walkspeed to normal, also if it’s lower than your desired max, use while loops to increase it. It’s kinda hard, but that’s scripting. Took me awhile to make. Don’t give up though, I’m having extreme trouble with data saving but I know I can do it eventually, cya.
@freshpeanut4967
@freshpeanut4967 4 жыл бұрын
Holy guacamole I was able to do the delete part all by myself before you even explained it, *IM LEARNING!*
@tepsy7666
@tepsy7666 3 ай бұрын
For some of you who wanna remember these things, i recommend spending a bit of time trying to make things with the skills you learnt like for example i made rain and i also made it so everytime you click you get a coin.
@creativecodling
@creativecodling 3 жыл бұрын
Congrats on 300k subscribers!!
@timothycooper-gn8se
@timothycooper-gn8se Жыл бұрын
if 14:25 dosent work, use "backspace" instead of delete
@branchRBLX
@branchRBLX Жыл бұрын
w manz
@BaconJeezbrgr
@BaconJeezbrgr Жыл бұрын
guys if this is not working for you in the recent roblox studio, try to go to the script and set run context from "legacy" to "client"
@shanahmed3860
@shanahmed3860 6 ай бұрын
UserInputService was one of the things that i found most weird strange and difficult but you just told me it in over 10mins!
@thefound_glitches4277
@thefound_glitches4277 2 жыл бұрын
made my own shift to sprint!
@TheKoziShow
@TheKoziShow 4 ай бұрын
In Roblox, Enum stands for Enumeration. An enumeration is a data type that consists of a set of named values, known as elements or members. In Roblox scripting, enums are used to represent a list of related values in a clear, readable way. Purpose of Enums: Enums are useful for representing a group of constants with descriptive names, such as directions, key codes, button types, material types, or mouse behaviors. Instead of using raw numbers or strings, enums provide an easy-to-read way to represent these values, which helps reduce bugs and makes code more maintainable. Example: Let's say you want to change the material of a part to wood. Instead of having to remember what value corresponds to "Wood", you can use the Enum.Material.Wood enumeration, which is far more intuitive. local part = workspace.Part part.Material = Enum.Material.Wood Here, Enum.Material.Wood is more descriptive than using an arbitrary number to represent wood. Common Enum Types in Roblox: Enum.Material: Represents the different materials that can be applied to a part (e.g., Enum.Material.Wood, Enum.Material.Metal, etc.). Enum.UserInputType: Represents different kinds of user inputs (e.g., Enum.UserInputType.MouseButton1, Enum.UserInputType.Touch, etc.). Enum.KeyCode: Represents different keyboard keys (e.g., Enum.KeyCode.Space, Enum.KeyCode.W, etc.). Enum.HumanoidStateType: Represents different states of a humanoid (e.g., Enum.HumanoidStateType.Running, Enum.HumanoidStateType.Jumping, etc.). Enum.SurfaceType: Represents the different surface types on a part (e.g., Enum.SurfaceType.Smooth, Enum.SurfaceType.Studs, etc.). Usage Example: local part = workspace.Part part.TopSurface = Enum.SurfaceType.Smooth local humanoid = workspace.Humanoid humanoid:ChangeState(Enum.HumanoidStateType.Walking) Benefits of Enums: Readability: Enums make code more readable by using descriptive names instead of numbers or strings. Error Prevention: Enums help prevent errors, as they limit possible values to a predefined list. Autocompletion: In Roblox Studio, using enums provides autocompletion, making it easier to select the right value while coding. Enums in Roblox are extremely helpful for making code more organized and less prone to errors, while also improving code readability.
@swiftyhackz951
@swiftyhackz951 4 жыл бұрын
hi tap water, you are the best scripter for me not only that also the best one to explain a lot that almost pop his brain just to teach and make us learn. thanks for your videos. you got a sub ;D
@MieysoFelix
@MieysoFelix 2 жыл бұрын
An Enumeration(also called enum ) is a data type that can take one of a set of values. For example, the SurfaceType enum is used to select what type of surface a BasePart has on a certain side, which can take the values "Glue", "Hinge", "Inlet", or a few more. These values act as constants in place of using ambiguous numbers or strings to set a value.
@spectrumtube7525
@spectrumtube7525 4 жыл бұрын
Awesome! I was able to make a run script with nothing but this video! Thank, and keep up the amazing work!
@IxyHiffxy
@IxyHiffxy 4 жыл бұрын
I don't know if anyone has figured it out, but I did! I figured out how to print out the key pressed concatenated with, per say, " is the key pressed!"! Here's the script: -- 'user' here stands for UserInputService, but I shortened it. user = game:GetService("UserInputService") user.InputBegan:Connect(function(input,gameProcessedEvent) if input.UserInputType == Enum.UserInputType.Keyboard then print(tostring(input.KeyCode).." is the key pressed!") end end)
@MiaTyux
@MiaTyux 5 ай бұрын
At 14:23, I don't understand that why we can't just make a variable for the part like: Local Part = game.Workspace.Part (outside of the event) and then why we can't do Part:Destroy(), it gives me an error when i do that
@Mr_hatman123
@Mr_hatman123 27 күн бұрын
bc of the outside event
@majeesto9473
@majeesto9473 3 жыл бұрын
this series has taught me so much bro you have no idea lol
@lamenartist
@lamenartist 2 жыл бұрын
I have a question, my keyboard is in azerty so my A key is Q how to make my A key be A ?
@Salsa-cookie
@Salsa-cookie 8 ай бұрын
Its based on qwerty kwyboard
@peerapatlerdlatthaporn1567
@peerapatlerdlatthaporn1567 4 жыл бұрын
These videos are unplanned and make it so exciting, like the video has random little things which help you feel better.
@zionstudios9080
@zionstudios9080 3 жыл бұрын
this is a year later but yeah so true
@peerapatlerdlatthaporn1567
@peerapatlerdlatthaporn1567 3 жыл бұрын
@@zionstudios9080 i still reply :>
@zionstudios9080
@zionstudios9080 3 жыл бұрын
@@peerapatlerdlatthaporn1567 Pog
@theconquerer7836
@theconquerer7836 3 жыл бұрын
cap, if you reply 24/7.. then reply to me. You would never!
@peerapatlerdlatthaporn1567
@peerapatlerdlatthaporn1567 3 жыл бұрын
@@theconquerer7836 hey
@abhinavsatheesh2295
@abhinavsatheesh2295 4 жыл бұрын
i made the shift running thing heres the code for u guys! UserInputService = game:GetService("UserInputService") player = game.Players.LocalPlayer UserInputService.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.LeftShift then player.Character.Humanoid.WalkSpeed = 20 --Speed Of the player when running! end end) UserInputService.InputEnded:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.LeftShift then player.Character.Humanoid.WalkSpeed = 16 end end)
@lmaoboibruh6933
@lmaoboibruh6933 17 күн бұрын
this video made me be able to code it so you can shift to run then unshift to go back to normal: local uis = game:GetService("UserInputService") local player = game.Players.LocalPlayer uis.InputBegan:Connect(function(input, gameProccesedEvent) if input.KeyCode == Enum.KeyCode.LeftShift then player.Character.Humanoid.WalkSpeed = 50 end end) uis.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.LeftShift then player.Character.Humanoid.WalkSpeed = 16 end end)
@okinawakor
@okinawakor 2 күн бұрын
awesome
@kahmauriaiken2982
@kahmauriaiken2982 Жыл бұрын
hey dev king i had got a little creative and did this UserInputSevice = game:GetService("UserInputService") UserInputSevice.InputBegan:Connect(function(input, gameProccesedEvent) if input.KeyCode == Enum.KeyCode.K then local Baseplate = game.Workspace.Baseplate wait(3) Baseplate.Material = "Wood" if input.KeyCode == Enum.KeyCode.E then wait(3) Baseplate.Material = "Plastic" else wait(2) Baseplate.Material = "Plastic" end end end)
@EpicLionBal
@EpicLionBal 11 ай бұрын
Brilliant tutorial!
@ikeatv3
@ikeatv3 Ай бұрын
Fun fact for anyone learning, as you are doing the function destroy() on a local script it is only occurring for you and not occurring in the server thus if you do this. It will do no physical change in the servers
@MatteoP04ita
@MatteoP04ita 4 жыл бұрын
13:07 is the part only deleted for the player? Or for the server too?
@tickogrey5846
@tickogrey5846 4 жыл бұрын
Only the player if filteringenabled is true , use remoteevents for the server to to do it
@MatteoP04ita
@MatteoP04ita 4 жыл бұрын
@@tickogrey5846 👌thank you
@RetroBoblox
@RetroBoblox Ай бұрын
In Roblox, an Enum is a group of named values that represent a set of constants. Enums are used to define a set of values that can be used in your script, making it easier to read and maintain your code. For Example Script: -- Define an enum called "Color" local Color = Enum.new("Color", { Red = 0, Green = 1, Blue = 2, })
@eleacy6231
@eleacy6231 4 жыл бұрын
THIS HELPED SO MUCH WITH MY PAINT TOOL!! Thank you!
@Clownzyy
@Clownzyy 3 жыл бұрын
Always remember to put the walkspeed back to normal at the input ended of a shift sprint btw i got stuck on it so heres help
@Dogey_Dogger
@Dogey_Dogger 11 ай бұрын
Thanks for this tutorial
@escriptrrblx3344
@escriptrrblx3344 4 жыл бұрын
11:00 if you probably wondering how he just makes a long spacing just click the TAB except pressing SPACE
@MrDarkVoid
@MrDarkVoid 8 ай бұрын
What is the difference between lokal variable and just a variable
@kazeykaze7422
@kazeykaze7422 4 жыл бұрын
I sadly stopped at 12:22 because I have to go to sleep :(
@maxisawesome7357
@maxisawesome7357 Жыл бұрын
At 13:06, on line six, you can do something as simple as: if input.UserInputType then
@lamedev1342
@lamedev1342 5 жыл бұрын
Are you ever going to teach animations? So when a player holds down a specific key an animation fires?
@blank6731
@blank6731 5 жыл бұрын
I already know that heheh lol
@TheDevKing
@TheDevKing 5 жыл бұрын
I actually did! In this video: kzbin.info/www/bejne/qp_ZnYqqqqiki9k
@RichRBLX
@RichRBLX 3 жыл бұрын
@@TheDevKing you replied a year later but ive also replied a year later
@serbiandude373
@serbiandude373 3 жыл бұрын
@@RichRBLX Two hours ago? Impossible. I thought i am the only one watching these tutorials 2 years later.
@RichRBLX
@RichRBLX 3 жыл бұрын
@@serbiandude373 lol like 2 months ago i actually decided to get closer to my dream and now i just watch all these videos
@vannypvp8648
@vannypvp8648 2 жыл бұрын
this is everything i learned 1- UserInputService = game:GetService("UserInputService") local eKeyPressed = false UserInputService.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.E then eKeyPressed = true while eKeyPressed == true do wait() print("Your Mom Is Mine") end end end) UserInputService.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.E then eKeyPressed = false while eKeyPressed == false do break end end end) 2- UserInputService.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.Delete then game.Workspace.Part:Destroy() end end) 3- UserInputService.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Keyboard then print("SHEESH") end end)
@zyxify9429
@zyxify9429 2 жыл бұрын
finally made a working gun ty
@Phaejix
@Phaejix 7 ай бұрын
Does the site that you used as a wiki at 2:18 still exist?
@riffler9929
@riffler9929 6 ай бұрын
it does its called devforum Documentation
@Tipicall
@Tipicall 2 жыл бұрын
3:02 saving timestand
@reheatz
@reheatz 3 жыл бұрын
8:48 sorry about my dog he just... shook
@yetikaqwe
@yetikaqwe 2 жыл бұрын
i think its late to ask this, but can some1 explain what input and gameProcessedEvent is for?
@Darksnake87
@Darksnake87 2 жыл бұрын
"input" is the key being pressed and "gameProcessedEvent" is if you're using the keyboard for something else like chat. it basically doesn't execute the code if you're typing in chat. for example if R is the reset button and you decide to type in chat it wont reset your character
@MattRBX
@MattRBX 2 жыл бұрын
thanks i made a basic flashlight script and a shift to run script using this as a test very helpful and easy to follow along if you have a small amount of scripting skills
@jaydenaleung
@jaydenaleung Жыл бұрын
13:11 To make the concatenation work just add a tostring(input.KeyCode) -->. print("Player pressed a key! Key: ".. tostring(input.KeyCode))
@GakkeCool
@GakkeCool Жыл бұрын
Or you could put input.KeyCode.Name and it would only do the key and not the entire input.KeyCode.
@Qvikzz
@Qvikzz Ай бұрын
I like how he answers the questions i'm thinking about like "How to hold it down"
@vitoawesome
@vitoawesome 5 жыл бұрын
Can u explain what metatables are and what they do in the next tutorial?
@Jimbo34451
@Jimbo34451 4 жыл бұрын
If you still don't know. devforum.roblox.com/t/all-you-need-to-know-about-metatables-and-metamethods/503259
@skator7356
@skator7356 Жыл бұрын
hi man i just wanted to ask why this isnt working: UserInputService = game:GetService("UserInputService") local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local XPosition = Mouse.X local YPosition = Mouse.Y UserInputService.InputBegan:Connect(function(input, gameProccesedEvent) if input.KeyCode == Enum.KeyCode.Q then local Meteor = Instance.new("Part", workspace) Meteor.Size = Vector3.new(10, 10, 10) Meteor.Position = Vector3.new(XPosition, YPosition, 100) end end) it just spawns out of the map and at 1 point too. is it because vector3 doesnt take variables?
@fishytimehaha
@fishytimehaha Жыл бұрын
very weird pls tell me if u found a fix im interested
@evilyxof
@evilyxof 8 ай бұрын
13:05 Here is what I did: uis = game:GetService('UserInputService') uis.InputBegan:Connect(function(input, gameProcessedEvent) if input.UserInputType == Enum.UserInputType.Keyboard then print("Key Pressed: "..input.KeyCode.Name) end end)
@Wolf-fj9tw
@Wolf-fj9tw 2 жыл бұрын
why do the comments have 499 im tired of being the 500th but these tutorials dripping tho
@unrealmagic7238
@unrealmagic7238 3 жыл бұрын
this what i was waiting for lets go
@cursedtoilet8035
@cursedtoilet8035 3 жыл бұрын
Teacher: What language do you speak? Me: Lua Teacher: Can you say a sentence in Lua? Me: local teacher = Earth.Workspace.Classroom.Teacher if teacher:print("Can you say a sentence in Lua?") then wait(5) print("hi my I like to play on Xbox") end
@sakyuta
@sakyuta 3 жыл бұрын
this is creative and i love it
@Th3Goober
@Th3Goober 3 ай бұрын
If you're having trouble with the script not working make sure it's a local script inside of StarterPlayerScripts
@ІлюхаПрохоров
@ІлюхаПрохоров 3 ай бұрын
ty
@randomperson9997
@randomperson9997 4 жыл бұрын
"i dont even know why, i just know that its there" im scared mommy
@StormyBoi6
@StormyBoi6 3 жыл бұрын
This video is very VERY helpful since userinput is a big part in most games
@roberto4057
@roberto4057 4 жыл бұрын
6:29 me when the teachr tells me how do i get the correct answer
@mengvang396
@mengvang396 Жыл бұрын
very nice tutorial! Was able to create my own sprint function!
@Master_Tomblox
@Master_Tomblox 4 ай бұрын
For someone that dont know what Enum means its just tells or adds things that are or can be in roblox studio like material, or keycode
@kerbiee6051
@kerbiee6051 Жыл бұрын
Yay I can now do a Shift to Sprint code! Thank you so much TheDevKing!
@batman6429
@batman6429 3 жыл бұрын
To have the pressed key appear with the phrase at the end just change the ".."to a "," 13:05
@Laugh_out_loud_hahah
@Laugh_out_loud_hahah 8 ай бұрын
Thx so much I'm learning a lot about scripting and the way you teach scripting is fun and understandable!
@pugplayz4089
@pugplayz4089 6 ай бұрын
yup
@Upsided
@Upsided 3 жыл бұрын
thanks for this! i was able to do a click tp to selected part
@greg_pizzatower
@greg_pizzatower 2 жыл бұрын
these tutorials help me a lot, keep it up
@wart4344
@wart4344 2 жыл бұрын
bbbbbbbbbbbbb
@TangerineKiller-zh6mw
@TangerineKiller-zh6mw 4 ай бұрын
Why do we use the LocalScript instead of a script???
@thegood_soup
@thegood_soup 4 ай бұрын
might be kinda late but without that then any button someone presses would register to everyone else as they pressed it, which could be bad or good in some scenarios
@kaze26113
@kaze26113 2 жыл бұрын
6:32 Look it up, that's what it's for. That's it's only purpose is to be looked up
@cliche_5860
@cliche_5860 4 жыл бұрын
Copied the script letter for letter except for the print, which I don't think would affect it, and I only get "Keycode is not a valid EnumItem"
@cliche_5860
@cliche_5860 4 жыл бұрын
Script for the detect key pressed (A) part*
@cliche_5860
@cliche_5860 4 жыл бұрын
Also when I press enter I'm not getting end pop up so i add it myself. Would that affect anything?
@cliche_5860
@cliche_5860 4 жыл бұрын
And for the multiple keys I didn't get any output.
@VSGAMESR
@VSGAMESR Жыл бұрын
Thanks! I did made a local script in it when you press "g" the part named dontpressg starts to lose its Transparency slowly and when its Transparency reached to 1 it gets destroyed dontpresssg = game.Workspace:WaitForChild("dontpressg") UserInputService.InputBegan:Connect(function(input,GameProccesedEvent) if input.KeyCode == Enum.KeyCode.G then for trans=0,10,1 do task.wait(0.3) dontpresssg.Transparency = trans/10 end if dontpresssg == 1 then game.Workspace.dontpressg:Destroy() end end end)
@anjleenadewan5204
@anjleenadewan5204 4 жыл бұрын
11:05 I’m confused
@hothclassic6833
@hothclassic6833 3 жыл бұрын
Late comment but basically what its saying is while aKeyPressed is true do
@Idk_Rush
@Idk_Rush 3 жыл бұрын
I understand soo much from you THank you so much!
@adhamcraft
@adhamcraft 4 жыл бұрын
why u didnt type "local" before UserInputService? and when i shouldnt do that?
@blanc590
@blanc590 3 жыл бұрын
Thanks to your very cool tutorial I made this script when you press E it fades the text in and gives you a fun fact every time! - local UIS = game:GetService("UserInputService") local TextExp = workspace.Load.gey.SurfaceGui.gay local t1 = "You're gay" local t2 = "you're yellow" local t3 = "i like oranges" local t4 = "eminem" local Facts = {t1, t2, t3, t4} UIS.InputBegan:Connect(function(input) local RandomFact = Facts[math.random(#Facts)] if input.KeyCode == Enum.KeyCode.E and TextExp.TextTransparency >= 1 then print("Fading in") TextExp.Text = RandomFact for x = 1,0,-0.1 do wait(0.1) TextExp.TextTransparency -= 0.1 end elseif input.KeyCode == Enum.KeyCode.E and TextExp.TextTransparency
@Lazu_o
@Lazu_o 2 жыл бұрын
can you tell me what is # used for? maybe that'll help me in the future
@findrandomshithere
@findrandomshithere Жыл бұрын
@@Lazu_o 1 year ago, but It gets the length of a table or a string.
@Lazu_o
@Lazu_o Жыл бұрын
@@findrandomshithere i know it now, but it'll probably help the novice scripters
@abhaypokhriyal2988
@abhaypokhriyal2988 3 жыл бұрын
"Enum" stands for "Enumeration."
@bigcheese8
@bigcheese8 4 жыл бұрын
If you don’t understand enum.. think of it as a list that roblox gives you, you refer to enum, the list, before you go to certain items like apples.
@Sl33pySt3rdust
@Sl33pySt3rdust 9 ай бұрын
i finally made my own Shift to Sprint script today. yay!
@trenchhez
@trenchhez 4 жыл бұрын
wow i used little bit of wiki and i made shift to run you make best tutorials
@_-_Lukkie_-_
@_-_Lukkie_-_ 11 ай бұрын
is this really needed cuz it was kinda boring and i didnt get any point of the video tbh (no hate i love your video's and the other tutorials are really good actually)
@scoutgaming737
@scoutgaming737 2 жыл бұрын
I wrote your code, but roblox says that KeyCode isn't a valid member of input
@scoutgaming737
@scoutgaming737 2 жыл бұрын
nevermind I just wrote Keycode instead of KeyCode
@WavyLayth21
@WavyLayth21 3 жыл бұрын
this is the script, you can change the Keybind by changing the J on line 4 and you can make it do something. you can put this in a script for notes: UserInputService = game:GetService("UserInputService") UserInputService.InputBegan:Connect(function(input,gameProccesedEvent) if input.KeyCode == Enum.KeyCode.J then -- Change the J to change the key print("I like Avatar the Last AirBender") end end)
@rimka05orrick90
@rimka05orrick90 2 жыл бұрын
why not yours, not the code itself TheDevKing doesn't work in my Roblox studio? I even tried to pass it from the local to the script via boolValue. Maybe it is necessary to enable some kind of setting? Help please (translated by a browser translator, sorry if nothing is clear)
@sleebyrose
@sleebyrose 4 жыл бұрын
Why does your shirt say Tap water? Is it about that thing in the UK
@320linkerbaan24
@320linkerbaan24 Жыл бұрын
You did a very good job on explaining
@unknownone9135
@unknownone9135 2 жыл бұрын
gameprocessedevent is basically if ur typign in chat so just say "if input == true then return end" means if ur typing on chat u wont activate the userinputservice
@b_simming
@b_simming 2 жыл бұрын
Can't wait for this tutorial!
@g-man1234
@g-man1234 3 жыл бұрын
It says key code isn’t a valid member of input object? What’s that
@ad7786-x7l
@ad7786-x7l 3 жыл бұрын
it says that by me to
@marynassuna3792
@marynassuna3792 2 жыл бұрын
Give more info I might understand
@b_simming
@b_simming 2 жыл бұрын
I put all the code I learned into one big function 😊
@findrandomshithere
@findrandomshithere Жыл бұрын
I think something's gonna break...
@oversansgaminggamer4156
@oversansgaminggamer4156 2 жыл бұрын
The one type of school i'm actually willing to participate in.
@alexonian2940
@alexonian2940 4 жыл бұрын
When I try it it comes out with an error 13:51:22.876 - Keycode is not a valid member of InputObject
@candy_cane3918
@candy_cane3918 4 жыл бұрын
I GOT THAT TOO!
@muhammadgachastudioandawes428
@muhammadgachastudioandawes428 4 жыл бұрын
Its KeyCode not Keycode
@K4E1234
@K4E1234 3 жыл бұрын
nice job this helped me out so much
@RaphaelGo
@RaphaelGo 3 жыл бұрын
I MADE A RUN SCRIPT WITH THIS VIDEO TYSM!!!
@rankedd2038
@rankedd2038 3 жыл бұрын
yo can you tell me how you got the humanoid?? because if you used findfirstchild its only gonna work for 1 person
@Lolmestud
@Lolmestud 6 ай бұрын
@@rankedd2038this might be too late but since userinputservice only works in local scripts, you can write a variable to define the player by using local “name”=game.players.localplayer
@ThatsValForYa
@ThatsValForYa 4 жыл бұрын
Am i the only one triggered that he spelt "processed" wrong and it still worked XD
@tablet7224
@tablet7224 4 жыл бұрын
no
@caesar70
@caesar70 5 жыл бұрын
Thanks! Nice tutorial
What Is The Best AI For Roblox Studio Scripting?
10:42
RoDev
Рет қаралды 486 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Joining This Server Drove Him Insane
24:11
Ondrae The Great
Рет қаралды 1,4 МЛН
Everything You Need To Start Making Games (As A Beginner)
16:11
Juniper Dev
Рет қаралды 182 М.
I Scripted Your Funny Roblox Ideas.. (Part 14)
8:08
TheDevKing
Рет қаралды 2,6 МЛН
Making My Own Programming Language and Coding a Game in It
10:19
AstroSam
Рет қаралды 1,3 МЛН
How pro Roblox developers learnt to script
10:03
AlvinBlox
Рет қаралды 872 М.
DON'T Make a Roblox Game Without Watching This First.
27:20
SmartyRBX
Рет қаралды 647 М.
You Don’t Understand How Language Works
10:46
Fractal Philosophy
Рет қаралды 148 М.
Investigation: How Roblox Is Exploiting Young Game Developers
22:44
People Make Games
Рет қаралды 2,5 МЛН
How Unoptimized Can a Roblox Game Get?
16:49
ByteBlox
Рет қаралды 322 М.
A new way to generate worlds (stitched WFC)
10:51
Watt
Рет қаралды 554 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН