Lua c roblox 튜토리얼;

코드 예제

0
0

lua roblox

--[[
The UserInputService allows the developer to do a certain thing once a Key
is pressed. 
UserInputService ONLY WORKS IN A CLIENT SCRIPT!!
--]]

local UIS = game:GetService("UserInputService") -- Get the Service

UIS.InputBegan:Connect(function(input, gameProcessedEvent)
--[[
The input is whatever key the player presses on their keyboard. 
The gameProcessedEvent is true if the player is chatting, sitting down or doing
core Roblox things. In most cases you want to only run your script if it is false.
--]]
	if not gameProcessedEvent and input.KeyCode == Enum.KeyCode.R then
    	print("The player pressed the "..input.KeyCode.Name.." Key!")
	end
end)

UIS.InputEnded:Connect(function(input, gpe)
	if not gpe and input.KeyCode == Enum.KeyCode.R then
    	print("The player stopped holding the "..input.KeyCode.Name.:" Key!")
	end
end)

-- [[
NOTE !!!!!!!!!! 
InputEnded MUST be used in a synchronized script.
--]]

비슷한 페이지

예제가있는 유사한 페이지

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................