Jump to content

Need help about toggle key to display some status ...

Recommended Posts

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 ]



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 by K41zel2
Link to comment
Share on other sites

current, I can type and say a word.

in "scripts/components" codes are


local ThePlayer = GLOBAL.ThePlayer
local TheInput = GLOBAL.TheInput
local TheNet = GLOBAL.TheNet
local SpawnPrefab = GLOBAL.SpawnPrefab

AddModRPCHandler(modname, "X", function(player)
    if not player:HasTag("playerghost") then

local kaizer_handlers = {}
    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
            kaizer_handlers[0] = nil

So now a problem is can I use inst or data in "prefabs/character.lua" and how ?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...