- Joined
- Dec 11, 2014
- Messages
- 2,004
This is causing a crash -__-
Any ideas on why?
JASS:
static method talk takes string s, real dur, sound snd returns nothing
local real x = 1 - (I2R(StringLength(s))*.004)
local real y = (R2I(I2R(StringLength(s))/70) + 1)*.1
// x and y will now create centered text
if snd != null then // check if sound is not null
call StartSound(snd)
if UseSoundDur then //use sound duration instead of parameter
set dur = I2R(GetSoundDuration(snd))*.001
endif
endif
call TimerStart(CreateTimer(), dur, false, function ClearTextMessages) //CRASHES HERE
call DisplayTimedTextToPlayer(Player(0), x, y, dur, "\n\n\n\n\n\n" + s + "\n\n\n\n\n\n\n\n\n\n\n\n") // create centered text.
endmethod
Any ideas on why?