Jump to content

scripts the same, 2 work but 1 doesnt? huh?


Deleted518329User

Recommended Posts

I have 3 scripts, they all have basically the same things except that different items are added each time. It activates when a door is activated and all was working fine.

To get the 3rd script working faster I copyed and pasted script number 2, but for some reason number 2 works but I get the error messege ' mismatched begin / end function on line 17, but both scripts are the same at the moment, so my question is, how can two scipts the same work fine but the 3rd one exactly the same doesnt work when its the same as the other 2?

 

Heres the script

 

ScriptName 01generatepower3

 

 

short button

short reactivate ; set to 1 to trigger automatic reactivation

short saved ; set to 1 first time player activates

 

 

Begin OnActivate

showMessage 00000powermessege3

 

endif

end

 

 

 

Begin Gamemode (LINE 17)

 

 

set button to getbuttonpressed

if button > -1

if button == 4

Player. Additem 1powervortexunstable 1

Player. Additem Ammoalienpowercell 9000000

activate player

else

if button == 0

 

Player. Additem 1powerenergysound 1

Player. Additem 1powerelectricshock 1

Player. Additem Ammoalienpowercell 9000000

activate player

elseif button == 1

Player. Additem 1powerenergygravity 1

Player. Additem 0GRAVITYLEVI 1

Player. Additem Ammoalienpowercell 9000000

activate player

elseif button == 2

Player. Additem 0rasiationnuclearesistance 1

Player. Additem 1powerenergynuclear 1

Player. Additem Ammoalienpowercell 9000000

activate player

elseif button == 3

Player. Additem 1powersrtenth 1

activate player

elseif button == 5

Player. Additem 2powerltelekenesis 1

Player. Additem 3telekenesis 1

Player. Additem 2powerltelekenesisPIN 1

Player. Additem Ammoalienpowercell 9000000

activate player

 

elseif button == 6

Player. Moveto 0selectback

endif

set reactivate to 1

endif

endif

Link to comment
Share on other sites

Copy and Paste this script. It's a corrected version of your own^^

 

ScriptName 01generatepower3


short button
short reactivate ; set to 1 to trigger automatic reactivation
short saved ; set to 1 first time player activates


Begin OnActivate
showMessage 00000powermessege3
end



Begin Gamemode


	set button to getbuttonpressed

if ( button == 0 )
	Player.Additem 1powerenergysound 1
	Player.Additem 1powerelectricshock 1
	Player.Additem Ammoalienpowercell 9000000
	activate player
elseif ( button == 1 )
	Player.Additem 1powerenergygravity 1
	Player.Additem 0GRAVITYLEVI 1
	Player.Additem Ammoalienpowercell 9000000
	activate player
elseif ( button == 2 )
	Player.Additem 0rasiationnuclearesistance 1
	Player.Additem 1powerenergynuclear 1
	Player.Additem Ammoalienpowercell 9000000
	activate player
elseif ( button == 3 )
	Player.Additem 1powersrtenth 1
	activate player
elseif ( button == 4 )
	Player.Additem 1powervortexunstable 1
	Player.Additem Ammoalienpowercell 9000000
	activate player
elseif ( button == 5 )
	Player.Additem 2powerltelekenesis 1
	Player.Additem 3telekenesis 1
	Player.Additem 2powerltelekenesisPIN 1
	Player.Additem Ammoalienpowercell 9000000
	activate player
elseif ( button == 6 )
	Player.Moveto 0selectback
	set reactivate to 1
endif
end

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...