Scripts / script now showing up

Author
Message
woodster555
6
Years of Service
User Offline
Joined: 1st Feb 2018
Location:
Posted: 8th Mar 2018 21:08
hi i am very new to lua and i was trying to do a converse script and nothing is poping when i click e on the npc and nothing is popping up and this is the script i did

--LUA Script - precede every function and global memeber with lowercase name script + '_main'
--player Converse

function converse_init(e)
texttime=0
stage=0
fin=0
end

function converse_main(e)
playerDist = GetPlayerDistance(e)
if playerDist < 100 then
if g_keypressE==1 and GetTimer(e)>texttime and fin==0 then
texttime=GetTimer(e)+1000
stage=stage+1
end
if stage==1 then
TextCenterOnX(50,50,3,"Hello.")
end
if stage==2 then
TextCenterOnX(50,50,3,"You are in deep shit my friend.")
end
if stage==3 then
TextCenterOnX(50,50,3,"RUN NOW!!")
end
if stage==4 then
fin=1
end
end
if PlayerDist>100 then
fin=0
stage=0
end
end

and for somrisen it does not work and cant figuar out why
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 8th Mar 2018 22:28
It's g_KeyPressE.

Lua is case sensitive.
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-12-22 19:45:41
Your offset time is: 2024-12-22 19:45:41