Jump to content

Recommended Posts

Trying to take this...

local RELICKEY = GetModConfigData("RELICKEY")--Relic Toggle Key

and link it to this in my custom character.lua

local function OnRelicKeyPressed(inst, data)    if data.inst == ThePlayer then        if data.key == "This is where the Config key goes" then            if TheWorld.ismastersim then                BufferedAction(inst, inst, ACTIONS.SKUSERELIC):Do()                -- Since we are the server, do the action on the server.            else                SendRPCToServer(RPC.DoWidgetButtonAction, ACTIONS.SKUSERELIC.code, inst, ACTIONS.SKUSERELIC.mod_name)            end        end    endend

The keybinding works with key_"whatever", but I want to give players the Config power.

@JadeKnightblazer, you need to make your RELICKEY variable into a global variable.

 

GLOBAL.RELICKEY = GetModConfigData("RELICKEY")

 

Now inside your custom character prefab you will be able to simply use RELICKEY.

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...