Scripts / (SOLVED) - Help! Script doesn't work.

Author
Message
Mr.Potato
8
Years of Service
User Offline
Joined: 25th Mar 2016
Location:
Posted: 25th Mar 2016 02:23
Why is this script isn't working?
(I've applied the script to entity i want to appear
Renamed the entity & set it to spawn at start = no
Placed the trigger zone & set ifused field to the name of the entity above)


PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 25th Mar 2016 11:08
i just tested it with a barrel and it is working.
i placed a barrel (dynamic, green when you hoover over the barrel)
give it the script and set to Always active = yes.
Then i placed a triggerzone, and in the if usedfield the name of the barrel.

I leaved the spawn at start to yes
and then it worked.
harry
SOS help for shelter :
http://www.worldofcrowdfunding.com/shelter-car-asiel-auto-coche-de-protectora

Harry
When nothing goes right, go left
PM
Mr.Potato
8
Years of Service
User Offline
Joined: 25th Mar 2016
Location:
Posted: 31st Mar 2016 16:45
It didn't work again! I have no ideia of what is going on.
I tried exactly as you (Harry) said, even used a barrel but nothing.
PLEASE HELP.
Do I have to do something to the script so it would work?
PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 31st Mar 2016 17:32
I can make a short video, but witch item did you try it ? , so i can see if thats the problem

harry

Harry
When nothing goes right, go left
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 31st Mar 2016 17:33
What version of Game Guru are you using?
Did you place the name of the barrel in the ifused in the trigger zone?
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, Screen resolution 1680 x 1050.

Mr.Potato
8
Years of Service
User Offline
Joined: 25th Mar 2016
Location:
Posted: 1st Apr 2016 00:52
Harry,
You'll be helping me a lot by making a short video.. I used
PM
Mr.Potato
8
Years of Service
User Offline
Joined: 25th Mar 2016
Location:
Posted: 1st Apr 2016 00:58
I try using a zombie entity
I did place the name of the barrel in the ifUsed but it still dindn't work and the version of Game Guru i'm using is 1.121
Thank for the help!
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 1st Apr 2016 02:08
Hmm. Works with the zombies and the barrels for me.

Try the below attached script and see if it works for you. Make a copy of your old one as the attached one is the same name.
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, Screen resolution 1680 x 1050.

Attachments

Login to view attachments
Mr.Potato
8
Years of Service
User Offline
Joined: 25th Mar 2016
Location:
Posted: 1st Apr 2016 03:22
Look! This are the properties settings of the zombie entity

What am I doing wrong?
I tried using Pirate Myke's script and it still doesn't work.


PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 1st Apr 2016 03:44 Edited at: 1st Apr 2016 03:45
Well my script is called just jumpscare.

Yours shows it as jumpscare1.lua

Which case that entity would not call the script I sent you.

So my best guest is that the functions inside your jumpscare1.lua script do not reflect the name of the lua script.
Yours probably reads function jumpscare_init(e) and function jumpscare_main(e), while the file name says jumpscare1
Change them to function jumpscare1_init(e) and function jumpscare1_main(e), save the lua file. Then save the map file in Game Guru and try it again.

This is the most basic requirement of LUA scripting and the most common reason why scripts do not work as intended when you duplicate the script. The function names of the script have to match the file name of the script. No capitals and no spaces or special characters are excepted in these name.

See if the attached script will make yours work. After you change your script if it still does not work.
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, Screen resolution 1680 x 1050.

Attachments

Login to view attachments
Mr.Potato
8
Years of Service
User Offline
Joined: 25th Mar 2016
Location:
Posted: 1st Apr 2016 16:54
Pyrate Myke,

It worked. THANK YOU SO MUCH MAN!
It was definitely a noob mistake haha but now it's all good.
Thx again
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 1st Apr 2016 17:14
Excellent. First scripting hurtle over come.
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, Screen resolution 1680 x 1050.

Login to post a reply

Server time is: 2024-12-22 15:23:51
Your offset time is: 2024-12-22 15:23:51