Forum

> > CS2D > Scripts > Tibia Error [Hudtext2]
Forums overviewCS2D overview Scripts overviewLog in to reply

English Tibia Error [Hudtext2]

5 replies
To the start Previous 1 Next To the start

old Tibia Error [Hudtext2]

AleDarck
User Off Offline

Quote
good afternoon
I could help, is giving me this error in functions.lua
This is the error

sys/lua/cs2dtibia/funcions.lua:431: <name> or '...' expected near '0'

This is the line code 431

1
2
3
function hudtxt2(id, "Hello World", 255255255, 320, 240, 1)
     parse("hudtxt2 " .. id .. " " .. txtid .. " \"©" .. tostring(colour) .. text .. "\" " .. x .. " " .. y .. " " .. align)
end

old Re: Tibia Error [Hudtext2]

Buksee
User Off Offline

Quote
@user AleDarck:
1
2
3
4
5
local txtid = 0
function hudtxt2(id,text, colour,x,y,align)
     parse("hudtxt2 " .. id .. " " .. txtid .. " \"©" .. tostring(colour) .. text .. "\" " .. x .. " " .. y .. " " .. align)
     txtid=txtid+1
end
Maybe?

old Re: Tibia Error [Hudtext2]

Cure Pikachu
User Off Offline

Quote
You completely destroyed the parameters in a function, that's why.
The default one looks like so:
function hudtxt2(id, txtid, text, colour, x, y, align)
	parse("hudtxt2 " .. id .. " " .. txtid .. " \"©" .. tostring(colour) .. text .. "\" " .. x .. " " .. y .. " " .. align)
end

To use a function, this is how it should look like:
hudtxt2(id,49,"Hello World",255255255,320,240,1)

old Re: Tibia Error [Hudtext2]

Dousea
User Off Offline

Quote
Nope.
color
argument won't work. Just put the colors inside the
text
argument.
1
2
3
function hudtxt2(id, textid, text, x, y, alignment)
	parse('hudtxt2 ' .. id .. ' ' .. textid .. ' "' .. text .. '" ' .. x .. ' ' .. y .. ' ' .. alignment)
end
To use it, well,
hudtxt2(1, 0, '\169255255255Hello, world!', 320, 240, 1)
.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview