like bdbodger using switch like that won do crud
unless u mean $player.size other than that u cant use it like that
are you trying to make the lights flicker? so he looks like hes going crazy?
try
Code: Select all
local.trigCR = spawn trigger_multiple
local.trigCR.origin = ( -990 -3010 -57 )
local.trigCR setsize ( -10 -10 -10 ) ( 10 10 10 )
local.trigCR setthread Peace_room
local.trigCR message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***"
local.trigCR wait 0
local.trigCR delay 0
Peace_room:
self waittill trigger
local.player = parm.other
if (local.player.isTrigger1==1)
end
local.player = parm.other
local.player tele ( -2120 -3005 -120 )
parm.other stopwatch 30 //$player is not defined use parm.other aka local.player
local.counter = 30
while(local.counter !=0)
{
local.counter -= 1
wait .25
local.player light 0 1 0 200
wait .25
local.player light 0 0 1 200
wait .25
local.player light 1 0 0 200
wait .25
}
local.player takeall
wait 5
local.player stufftext "say Oh no, i'm getting crazy..!"
wait 25
local.player respawn
//if (local.player.health <= 0)
end
and yes i did answer your question just not in full
the code above should make the player after triggering change colors really fast and stoner like for 30 seconds then it will take all his guns, make him say "Oh no, i'm getting crazy..!" then 25 secs later he will respawn
BUT, u do need to learn how to do this so
while is a looping command (keeps rececking as longs as the statement in the () are true or 1) hence why while(1) loops for ever. Loops need a wait in them. doesnt have to be long but like a waitframe will stop it from being a crashing script.
So in the example above it is saying in english:
while the counter does not equa ( != )l 0. then do this....
the counter was predefined to 3 above the loop and in the loops it subtracts 1. now to make it a second i had 4 X .25 waits between each wait was a different color he changed to.
Now onto the switch command
The switch command is basically a whole bunch of IF's
If you have taken geonmetry you would have learned about conditional statements.
IF's are a conditional statement that means this in geometry:
If ___
Q_____, Then _____
P____ .
Q is the hypothesis and P is the conclusion
so...
Code: Select all
if(local.player.isghey==1)
{ <---- These as bdogger taught me on TMT Starts And ends the statement
then do this
}
Now on to switch
Switch is when you want to test the same variable for different things
so
Code: Select all
switch ( local.message )
{
case "1":
println "You NEED to have beaks
break
case "2":
println "after each of these"
break
case "3":
println "to stop it from checking the rest"
break
}
The For Command means for as long as....
its like while but checks wats inside the () in a certain order
Now you were using:
That cant do anything
you can only use a defined player
Look at my other post to learn ways to define a player
self <------ When a player threads something he becomes self
eg...
parm.other <----- Is a player that sets off a trigger
eg
$player[local.i] <------ Works in conjunction with the for command as show in my other post
good luck with your mod i hope this helps