Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

User Input Help?

Asked by 9 years ago

I need to know the types of scripts to use when trying to make something happen if a user presses something. What I want to do is make the player fly when he presses F, but without making a tool to do it.

1 answer

Log in to vote
0
Answered by
Mystdar 352 Moderation Voter
9 years ago

Look in previous questions, the key part has been asked many times, you are privileged enough to have access to the internet,use it before coming here on functions like this Key one, do your research first. Anyhow, I will give you the Key script, the rest you will have to figure out yourself, in future show us some scripting attempts or I shouldn't really help you at all. This is not a request site. In a Local script:

player = game.Players.Localplayer
Mouse = player:GetMouse()

Mouse.KeyDown:connect(function(key)
    if key:lower() == "f" then -- If the key is f
    -- Do as you wish
    end
end)
0
Aren't keys automatically in lowercase? VariadicFunction 335 — 9y
0
Eh? Mystdar 352 — 9y
0
Thank you very much. I'm sorry, really sorry. PixelMixer 15 — 9y
0
Yes, Zack, you're right key downs are either lowercase strings, or key:bytes([number]). Pixel just experiment with different things look at free model scripts, and you will learn , come back here if you have any other scripting related questions, just include code. Mystdar 352 — 9y
View all comments (4 more)
0
Alright PixelMixer 15 — 9y
0
Good, as a piece of advice, i'm not sure of your level of scripting, however if you're still beginning learning Lua, then you need to start small and work up. Mystdar 352 — 9y
0
I am still beginning, In a way, i'm teaching myself. I'm not doing any tutorials other than asking questions here, and the way I'm learning is breaking apart models and adding stuff to them and seeing what they do. PixelMixer 15 — 9y
0
Good way to start Mystdar 352 — 9y
Ad

Answer this question