Scripts / Prompt script crashes fpsc

Author
Message
Slaur3n
GameGuru TGC Backer
16
Years of Service
User Offline
Joined: 16th Sep 2008
Location: Norway
Posted: 27th May 2014 22:58
Have tried to insert prompt scripts into the entities "main". But the program crashes because of this. can someone help me, tell me step by step what i have to do?
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 27th May 2014 23:04
you need to write the script, save it as .lua and then link the "main" to it



if you click the "main" field it should have ... at the end, click this and it'll open a window for you to select the script to use.

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Slaur3n
GameGuru TGC Backer
16
Years of Service
User Offline
Joined: 16th Sep 2008
Location: Norway
Posted: 27th May 2014 23:08
yep done that



ive used this "display cash" script that was posted on the forum.



-- LUA Script - precede every function and global member with lowercase name of script + '_main'

-- Player Displays Cash amount When nearby



function displaycash_main(e)

PlayerDX = g_Entity[e]['x'] - g_PlayerPosX;

PlayerDY = g_Entity[e]['y'] - g_PlayerPosY;

PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ;

PlayerDist = math.sqrt(math.abs(PlayerDX*PlayerDX)+math.abs(PlayerDY*PlayerDY)+math.abs(PlayerDZ*PlayerDZ));



if PlayerDist < 80 then

Prompt("key is on the second floor");

end

end
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 27th May 2014 23:27 Edited at: 27th May 2014 23:28
make sure the file is called displaycash.lua



or name it whatever you like and change the line

function displaycash_main(e)

to

function *newname*_main(e)

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Slaur3n
GameGuru TGC Backer
16
Years of Service
User Offline
Joined: 16th Sep 2008
Location: Norway
Posted: 27th May 2014 23:34
error message : no function called displaycash



Do i need another script?
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 28th May 2014 00:08
was the code above not taken directly from your file?

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 28th May 2014 10:04
Make sure filename is displaycash.lua and the function is function displaycash_main(e)

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
Slaur3n
GameGuru TGC Backer
16
Years of Service
User Offline
Joined: 16th Sep 2008
Location: Norway
Posted: 28th May 2014 15:03
yep, i just used the original displaycash script made by dvader i think. And that crashes too.. Has to be the new update ?



Or can you guys give me a script that you use, and that works?

Login to post a reply

Server time is: 2024-12-22 01:01:15
Your offset time is: 2024-12-22 01:01:15