Bully-Board

Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: UltimateGamer9 on August 08, 2015, 11:01:43 PM

Title: Help me out
Post by: UltimateGamer9 on August 08, 2015, 11:01:43 PM
How do I use TerminateThread? I need it for something.
Title: Re: Help me out
Post by: DaBOSS54320 on August 08, 2015, 11:10:42 PM
CreateThread returns a handle to the created thread, which you can use with TerminateThread to terminate the thread.

For example:
Code: [Select]
function main()
Wait(500)
local thread = CreateThread("F_PrintShit")
while true do
if IsButtonBeingPressed(3,0) then
TerminateThread(thread)
end
Wait(0)
end
end

function F_PrintShit()
while true do
TextPrintString("shit",0,1)
Wait(0)
end
end

Pressing the zoom-out button there will stop shit from being printed.