Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using { /Fortnite.com/Devices }
- using { /Verse.org/Simulation }
- using { /UnrealEngine.com/Temporary/Diagnostics }
- using { /Fortnite.com/Devices }
- using { /Verse.org/Simulation }
- using { /UnrealEngine.com/Temporary/Diagnostics }
- # A creative device that cycles through Thai and English body parts on a HUD message device.
- hello_world_device := class(creative_device):
- # Converts a string into a localizable message required by the HUD device
- DisplayMessage<localizes>(S:string): message = "{S}"
- @editable
- MyHUD: hud_message_device = hud_message_device{}
- @editable
- MyButton: button_device = button_device{}
- # Starts at -1 so the first click increments it to 0
- var IndexValue: int = -1
- # Array containing 50 vocabulary words (indices 0 to 49)
- Words: [] string = array {
- "หัว"," Head ","หน้า ","Face ","ตา","Eye ",
- "หู","Ear","จมูก","Nose","ปาก","Mouth",
- "ริมฝีปาก","Lip","ฟัน","Teeth","ลิ้น","Tongue",
- "ผม","Hair","คิ้ว","Eyebrow","คอ","Neck",
- "ไหล่","Shoulder","แขน","Arm","มือ","Hand",
- "นิ้ว","Finger","ข้อศอก","Elbow",
- "หน้าอก","Chest","ท้อง","Stomach",
- "หลัง","Back","ขา","Leg","เท้า","Foot",
- "หัวเข่า","Knee","ข้อเท้า","Ankle","นิ้วเท้า","Toe"
- }
- # Runs when the game begins
- OnBegin<override>()<suspends>:void=
- MyButton.InteractedWithEvent.Subscribe(DisplayWord)
- # Handles the button interaction logic
- DisplayWord(Agent: agent): void =
- # Words.Length is 50, so (Words.Length - 1) evaluates to 49 safely
- if (IndexValue < Words.Length - 1):
- set IndexValue = IndexValue + 1
- if (ThisWord := Words[IndexValue]):
- MyHUD.SetText(DisplayMessage(ThisWord))
- MyHUD.Show()
- else:
- # Loop back to the first word (index 0) and display it immediately
- set IndexValue = 0
- if (ThisWord := Words[IndexValue]):
- MyHUD.SetText(DisplayMessage(ThisWord))
- MyHUD.Show()
Advertisement