Don't know how to add partial chat to string

misterurafag

New Member
Reaction score
0
Ok what i'm basically looking to do is to have players say -bet and a gold amount (example -bet 99) and only take the gold amount (99) and add that to a custom string. any ideas?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Set myIntegerVariable = Integer(SubString((Entered chat string), 6, Length of (Entered chat string)))

Where "integer" comes from "conversion - convert string to integer".
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
wow ty very much i still really don't understand how it works but it does ty very much.

Substring takes a part of a string. It takes 3 things, a string (the original full string), a starting point, and an ending point. Then it takes the characters from the starting point to the ending point and returns them. AceHart's solution takes all the characters from 6 to the end of the string.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top