Scripts / Prompt text issue

Author
Message
magicmolecules
4
Years of Service
User Offline
Joined: 4th Dec 2019
Location:
Posted: 11th Jan 2020 15:03 Edited at: 11th Jan 2020 15:03
so i made my first script, but i ran in to some issues. The result i want is to prompt text that only displays once,

the first script:

function promptonce_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 700 then
Text(50,50,1,'some text');
end
end

it' works but i can't find a way to play just once

second i made with GetPlayerInZone:


function promptdestroy_init(e)
end

function promptdestroy_main(e)
if (GetPlayerInZone(e)) == 1 then
Text(50,50,1,'some text');
elseif (GetPlayerInZone(e)) == 0 then
Destroy(e);
end
end

with this i guess it's destroyed before i enter the zone?

I would be grateful if someone can help me out

Attachments

Login to view attachments
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Jan 2020 16:12
this should work for you
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
magicmolecules
4
Years of Service
User Offline
Joined: 4th Dec 2019
Location:
Posted: 11th Jan 2020 17:43
Thanks @smallg it helps alot
PM

Login to post a reply

Server time is: 2024-04-24 08:58:48
Your offset time is: 2024-04-24 08:58:48