Princesa Elfica Posted May 23, 2023 Share Posted May 23, 2023 Hello there, It's my 1st time trying to create a mod and just testing creating a function that increase level on player kill , just a simple thing like local function onkill(inst, data) local victim = data.victim if IsValidVictim(victim) then inst.level = inst.level + 1 end end inst:ListenForEvent("killed", onkilll) but I have no idea how to show this level to see if its working Link to comment https://forums.kleientertainment.com/forums/topic/147922-how-to-i-show-a-message-on-screen/ Share on other sites More sharing options...
-LukaS- Posted May 25, 2023 Share Posted May 25, 2023 (edited) If you're goal is to simply test whether the level increase works or not then using print() is your best option. If you're planning on actually creating a widget to visualize players level then there's a lot of things you'd need to do like creating a widget, putting it in PlayerHud, creating a mod RPC handler. For simple testing I would recommend just using print(). To see what's being printed you need to check either the client_log or the server_log depending on where you run the function. You also seem to have accidentally written `onkilll` instead of `onkill` in ListenForEvent. Edited May 25, 2023 by -t- 1 Link to comment https://forums.kleientertainment.com/forums/topic/147922-how-to-i-show-a-message-on-screen/#findComment-1636699 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