Jump to content

strange string problem


IIYAMA

Recommended Posts

  • Moderators
Posted

One of the last things I have to learn is working with strings, I still hate that part because I always make a lot of mistakes with it.

local defaultColour = tocolor(255,255,255) 
outputChatBox(tostring("#" .. defaultColour) .. "hoi",255,255,255,true) 
  

I have simply no idea what is wrong. My brain is a little bit roasted, (it feels like that)

result :

#-1 hoi

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
One of the last things I have to learn is working with strings, I still hate that part because I always make a lot of mistakes with it.
local defaultColour = tocolor(255,255,255) 
outputChatBox(tostring("#" .. defaultColour) .. "hoi",255,255,255,true) 
  

I have simply no idea what is wrong. My brain is a little bit roasted, (it feels like that)

result :

#-1 hoi

What are you trying to do?

Maybe this could help you? https://wiki.multitheftauto.com/wiki/RGBToHex

Paid developer. Twitter: @willia_am -

http://www.williamdasilva.fr
  • Moderators
Posted

ah yes thank you, thank you, thank you

I thought tocolor would convert also to hex numbers so I only had to add #.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...