[Lua]Script Help

yPower

Новичок
Автор темы
6
1
I wrote this code in more or less 6 hours or less of study of wiki but I not find the function to the comment that are in the code, so I ask for help in discord but I see that 'em don't help in discord , are fixed comment there, so I decided to post here to some help.


script_name ("autocommandafterdeath")
script_author ("yPower")

require "lib.moonloader"

fuction main ()
if not isSampLoaded () then return end
while not isSampAvailable () do wait (100) end
while true do - loop infinito
if sampIsLocalPlayerSpawned () or isPlayerDead () == true then
wait (5)
--Here i need the function that send a command that already registred in server-side, so which is? Like:
sendcommandregistered (example)
else
while not sampIsLocalPlayerSpawned () or not isPlayerDead () then
end
end
 
Последнее редактирование:

yPower

Новичок
Автор темы
6
1
What is wrong with this code?


script_name("autocommandafterdeath")
script_author("yPower")
script_dependencies('SAMPFUNCS ^5.3')

--carrega as constantes MoonLoader, este arquivo contém os códigos de chave
require "lib.moonloader"
require "lib.sampfuncs"

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
if sampIsLocalPlayerSpawned() or isPlayerDead() == true then
wait(5)
sampSendChat(hide)
else
return end

end
 

RiTwin

Новичок
20
12
Try that
Lua:
function main()
 while not isSampAvailable() do wait(100) end
 while true do
 wait(0)
  if sampIsLocalPlayerSpawned() or isPlayerDead() == true then
     wait(5)
     sampSendChat('/command or text') else return
  end
 end
end