MaksoPL
Member
Posts: 51
Threads: 26
Joined: Mar 2014
Reputation:
0
|
Script Error
Hi. My next script error. main (11,1) ERR: Unexpected token. That's my script:
void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
}
void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages","Alexander",10);
}
{
AddUseItemCallback("","key1","door1","Door",true);
}
void Door (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false)
}
|
|
03-30-2014, 08:20 PM |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
RE: Script Error
(03-30-2014, 08:20 PM)MaksoPL Wrote: {
AddUseItemCallback("","key1","door1","Door",true);
}
This is your problem. To fix it, simply move it to OnStart().
Try this!
void OnStart() { AddEntityCollideCallback("Player","alexander1","Message1",true,1); AddUseItemCallback("","key1","door1","Door",true); }
void Message1(string &in asChild, string &in asParent, int alState) { SetMessage("Messages","Alexander",10); }
void Door (string &in asItem, string &in asEntity) { SetSwingDoorLocked("door1",false,true); PlaySoundAtEntity("","unlock_door","door1",1,false) }
Discord: Romulator#0001
|
|
03-30-2014, 09:04 PM |
|
MaksoPL
Member
Posts: 51
Threads: 26
Joined: Mar 2014
Reputation:
0
|
RE: Script Error
(03-30-2014, 09:04 PM)Romulator Wrote: (03-30-2014, 08:20 PM)MaksoPL Wrote: {
AddUseItemCallback("","key1","door1","Door",true);
}
This is your problem. To fix it, simply move it to OnStart().
Try this!
void OnStart() { AddEntityCollideCallback("Player","alexander1","Message1",true,1); AddUseItemCallback("","key1","door1","Door",true); }
void Message1(string &in asChild, string &in asParent, int alState) { SetMessage("Messages","Alexander",10); }
void Door (string &in asItem, string &in asEntity) { SetSwingDoorLocked("door1",false,true); PlaySoundAtEntity("","unlock_door","door1",1,false) }
Main (16,1) ERR: Expected ';'
|
|
03-30-2014, 09:07 PM |
|
Neelke
Senior Member
Posts: 668
Threads: 82
Joined: Apr 2013
Reputation:
26
|
RE: Script Error
void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
AddUseItemCallback("","key1","door1","Door",true);
}
void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages","Alexander",10);
}
void Door (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false);
}
A missing ; in PlaySoundAtEntity.
Derp.
|
|
03-30-2014, 09:21 PM |
|
7heDubz
Posting Freak
Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation:
41
|
RE: Script Error
so you can debug your own files
16,1 means
16 lines down from the top
and
1 character over from the right.
|
|
03-30-2014, 10:26 PM |
|
|