Scripts / Script / Program Bug

Author
Message
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 1st Oct 2015 11:29
Hi, can someone help me out with this, i tried adding health to the entity wall and the lua script that i have added on the entity wall is named ammocount , now the problem is , when i tried firing on that wall at CLOSE RANGE my script works correctly, by adding 1 ammo on the ammo variable, however when i tried firing on that wall again from AFAR , it adds a significant random huge number which is greater than 1 instead of 1 ...

Here is my script


Here is a screen shot when i tried firing the wall entity at CLOSE RANGE


Here is a screenshot when i tried firing the wall again for the 2nd time from AFAR
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 1st Oct 2015 14:34
I am going to move this thread to scripting as it is not a program bug.

Thank you
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Oct 2015 18:57 Edited at: 1st Oct 2015 18:57
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 1st Oct 2015 19:08
i tried replacing my code with yours smallg but it still doesn't work, when the player is too far away, the ammo keeps on incrementing by a significant number that is greater than 1 instead of adding 1 only .. can you please help me out on this?
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Oct 2015 19:11 Edited at: 1st Oct 2015 19:28
script works perfect, adds 1 each time until i am literally out of firing range, you have other scripts conflicting?
edit ok i see the issue is the always active command, turn it on - p.s. your original script works fine already when always on

1 last edit, if you change the hp check a little it does work as i expected without needing to be always active (although it's still better to keep it always active due to the extra range if you can)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 1st Oct 2015 19:23
Great!, yeah , it's the always active command!!.. thanks
PM
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 1st Oct 2015 19:25
by the way, do you happen to have any invisible / transparent entity that can serve as my wall that can receive my bullet? .. because if i set my entity to be Hidden or Hide(e) .. the bullet just passess through the Entity that is hidden and the code / script that is attach to that entity will not work ..
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Oct 2015 19:31
yh you can use rofly's invisible wall
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 1st Oct 2015 19:36 Edited at: 1st Oct 2015 20:04
Thank you for your help Smallg
PM

Login to post a reply

Server time is: 2024-12-22 06:48:35
Your offset time is: 2024-12-22 06:48:35