K41zel2 Posted July 3, 2017 Share Posted July 3, 2017 (edited) Greeting Modder. I just finish some content of my mod and found problem I can't solve by myself. My mod can eat gems to rise his level and problem is I can't write codes that press a key to display status. (Screenshot to explain what I wan to do) [ Form Mod : [DST] Musha ] Spoiler the simple explain what I want is I press key L on keyboard and then my level show up like that screenshot I try to read other mod code, copy them or try to write but still got error...... Could someone guide me please ? It's would be pleasure, Thank you so much Here it is my mod : Edit : forgot to attach my mod Orz Edited July 3, 2017 by K41zel2 Link to comment https://forums.kleientertainment.com/forums/topic/80347-need-help-about-toggle-key-to-display-some-status/ Share on other sites More sharing options...
K41zel2 Posted July 6, 2017 Author Share Posted July 6, 2017 current, I can type and say a word. in "scripts/components" codes are Spoiler local ThePlayer = GLOBAL.ThePlayer local TheInput = GLOBAL.TheInput local TheNet = GLOBAL.TheNet local SpawnPrefab = GLOBAL.SpawnPrefab local KEY_X = GLOBAL.KEY_X AddModRPCHandler(modname, "X", function(player) if not player:HasTag("playerghost") then player.components.talker:Say("....") end end) local kaizer_handlers = {} AddPlayerPostInit(function(inst) inst:DoTaskInTime(0, function() if inst == GLOBAL.ThePlayer then if inst.prefab == "kaizer" then kaizer_handlers[0] = TheInput:AddKeyDownHandler(KEY_X, function() local screen = GLOBAL.TheFrontEnd:GetActiveScreen() local IsHUDActive = screen and screen.name == "HUD" if inst:IsValid() and IsHUDActive then SendModRPCToServer(MOD_RPC[modname]["X"]) end end) else kaizer_handlers[0] = nil end end end) end) So now a problem is can I use inst or data in "prefabs/character.lua" and how ? Link to comment https://forums.kleientertainment.com/forums/topic/80347-need-help-about-toggle-key-to-display-some-status/#findComment-937401 Share on other sites More sharing options...
K41zel2 Posted July 7, 2017 Author Share Posted July 7, 2017 Now my problem solved. Thank you modder and myself ~~ Link to comment https://forums.kleientertainment.com/forums/topic/80347-need-help-about-toggle-key-to-display-some-status/#findComment-937723 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now