Forum

> > CS2D > Scripts > Tibia Error [Hudtext2]
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Tibia Error [Hudtext2]

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Tibia Error [Hudtext2]

AleDarck
User Off Offline

Zitieren
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

alt Re: Tibia Error [Hudtext2]

Buksee
User Off Offline

Zitieren
@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?

alt Re: Tibia Error [Hudtext2]

Cure Pikachu
User Off Offline

Zitieren
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)

alt Re: Tibia Error [Hudtext2]

Dousea
User Off Offline

Zitieren
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)
.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht