Scripts / lua script help please

Author
Message
tripper
17
Years of Service
User Offline
Joined: 12th Oct 2007
Location: United Kingdom
Posted: 2nd Apr 2014 10:43
hello all i cant get this script to work in reload





function script_main (e)

if vlh_PlayerDist (e) <=50 then

Prompt ('Hello All')

end

end



it keeps returning

tripper1977
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Apr 2014 15:00
not sure why u have
Quote: "if vlh_PlayerDist (e) <=50 then"


it should be
Quote: "if PlayerDist < 50 then"
like in the default scripts



also make sure you are naming the scripts correctly (file name also needs to be "script" in this case





the full script will look like this



life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
tripper
17
Years of Service
User Offline
Joined: 12th Oct 2007
Location: United Kingdom
Posted: 2nd Apr 2014 19:01
hi i have tried what you have put it dosent give me any errors any more but it don't display any text on screen do i have to make huds for reloaded thank you for your time

tripper1977
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Apr 2014 00:04
i would guess you are not actually getting within the range of the target entity, try this to see how far away you are.





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: 3rd Apr 2014 11:33
i find it best to start at least at 100 for distance checks to see how it works with your objects and tweaking to your liking from there

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
tripper
17
Years of Service
User Offline
Joined: 12th Oct 2007
Location: United Kingdom
Posted: 3rd Apr 2014 11:50
hello all yes i change < to 100 and it works perfect thanks for all your help

tripper1977
Avram
GameGuru TGC Backer
18
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 3rd Apr 2014 12:55
Do you have vlh_PlayerDist() function defined? According to the vlh_ prefix, it seems you've taken function name from my Visual LUA designer, but note that you need to include (require) .lua file where the script is defined into your code.



btw. if vlh_PlayerDist(e) <= 50 will check if distance is 50, 49, 48, 47, ... units and if vlh_PlayerDist(e) < 50 will check if the distance is 49, 48, 47... that's the only difference and 1 FPSC unit difference is almost unnoticeable.

tripper
17
Years of Service
User Offline
Joined: 12th Oct 2007
Location: United Kingdom
Posted: 3rd Apr 2014 14:05
hi yes i did take it from your Visual LUA designer very good program very helpful as well but i couldn't get it to work for some reason but all good now finally got it working so thanks for all your help

tripper1977

Login to post a reply

Server time is: 2024-12-22 01:03:58
Your offset time is: 2024-12-22 01:03:58