silveralol
Advanced OT User
- Joined
- Mar 16, 2010
- Messages
- 1,480
- Solutions
- 9
- Reaction score
- 212
hello folks, I'm trying make something, so
with a string I want get the informations for the stuff
string = rat, 40, 100, 100, 40
where:
rat = name
40 = lvl
100 = healthnow
100 = maxhealth
40 = loot bonus
how I can get these informations with that string ?
I try with this for exemple:
I did not understood that 4 in the separatorPos line, so please someone give some help
with a string I want get the informations for the stuff
string = rat, 40, 100, 100, 40
where:
rat = name
40 = lvl
100 = healthnow
100 = maxhealth
40 = loot bonus
how I can get these informations with that string ?
I try with this for exemple:
Code:
local separatorPos = strings:split(",", 4)
if separatorPos ~= nil then
name = (strings[1])
level = (strings[2])
health = (strings[3])
maxHealth = (strings[4])
lootBonus = (strings[5])
end
local text = "Name: " ..name.. "\nLevel: " ..level.. "\nHealth: "..health.."/" ..maxHealth.. "\nBonus: " ..lootBonus.. "."