Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 29th Jan 2012 21:50
Hey all,
i have decided i am going to start scripting,
i have started on my first script but im stuck.
i am trying to make a medkit script,below

i carnt seem to get it working.
i dont want anyone to tell me the right way but to help me work it out. need help ASAP because i could use this script badly.

''Make sure your hands are clean before you point the finger''
Eggie
14
Years of Service
User Offline
Joined: 10th Oct 2010
Location:
Posted: 29th Jan 2012 22:18 Edited at: 29th Jan 2012 22:19
remove the commas after plrdistwithin
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 30th Jan 2012 10:21
1. you should give it a description behind DESC, can cause problems.

2. if removing commas doesnt work, add "state=0," in front of plrdistwithin.

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 30th Jan 2012 16:17
ok will try now

''Make sure your hands are clean before you point the finger''
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 30th Jan 2012 16:36
i have dont this but the weapon doesent fully go and it adds more than 30 health,see pic

''Make sure your hands are clean before you point the finger''

Attachments

Login to view attachments
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 30th Jan 2012 16:49
i have now decided to alter the script to this

and the other script is

i carn't see what went wrong

''Make sure your hands are clean before you point the finger''
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 30th Jan 2012 17:18 Edited at: 30th Jan 2012 17:22
you have to learn basic scripting methods. fpsc doesnt like to get actions in the first line sometimes, especially without a state.

when you wanna do loops, you also have to work with states to loop back when a state is checked.



something like this. look into your scriptbank-folder and search there for a zonescript called "plrhealthinzone" or something like that. this does what you try with the second script.

and by the way: dont know what you wanna do with the first script, but keypressed= has to be followed by a number instead of what letter it is. look into your docs-folder and read the official community guide, you can learn a lot out of the scripts in there. in addition look into the first stickie in the scriptboard: ched´s complete syntax script list (http://forum.thegamecreators.com/?m=forum_view&t=180924&b=23), this is your PONDS-vocabulary for fpsc-scripting

and second addition: the forum-search-field down each site here is your best friend. there are not that much scripts out there that are not written yet, even only to see how others do things.

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 30th Jan 2012 18:04 Edited at: 30th Jan 2012 18:13
ok i have changed my script now testing to see if it works,

EDIT:
still not working, i'll change a few things

''Make sure your hands are clean before you point the finger''
gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 30th Jan 2012 18:20 Edited at: 30th Jan 2012 18:21
Quote: "i have now decided to alter the script to this+ Code Snippet

;Artificial Intelligence Script

;Header

desc =

;Triggers

:keypressed=f:runfpi=my script
:plrdistwithin=70:hideplrweapon

;End of Script


and the other script is
+ Code Snippet

;Artificial Intelligence Script

;Header

desc =

;Triggers

:plrdistwithin=70:plraddhealth=1

;End of Script"

i have changed to

and

still dont work

''Make sure your hands are clean before you point the finger''
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 31st Jan 2012 09:16
Quote: "runfpi=my script"


change to "runfpi=my_script" and rename the script equal, fpsc dont want freespace in names.
also you have to place the named script into scriptbank-folder, nowhere else. fpsc can only read scripts out of there.

is the second script the runfpi-script you wanna start? not neccessary to do 2 scripts for this. causes more problems than simply using a single script.

still no DESC.

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 31st Jan 2012 17:01 Edited at: 31st Jan 2012 17:09
ok but how would i be able to make sure that you need to be within 70units and have less health than 100,
would this work???
,
i have got the script almost working with the above but the weapon doesent fully go untill i move out of range

''Make sure your hands are clean before you point the finger''
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 31st Jan 2012 17:09 Edited at: 31st Jan 2012 17:19
i never used plrweapon-functions, so cannot say for sure. could be that you have to do the addhealth in another line so the script doesnt try to hide the weapon again and again.



something like this. i am at work, so cannot test in build.

gozzy1999
13
Years of Service
User Offline
Joined: 11th Jun 2011
Location: in the closet
Posted: 31st Jan 2012 17:21 Edited at: 31st Jan 2012 18:11
ok, i will try on a different line.

Edit:
i have changed a few bits but have now got it to a preety decent medkit script with sound


''Make sure your hands are clean before you point the finger''

Login to post a reply

Server time is: 2024-11-24 01:59:19
Your offset time is: 2024-11-24 01:59:19