Page 3 of 3
Posted: Wed Jun 13, 2007 4:09 pm
by zaroba
i woulden't mind seeing a way to set a random resault for something.
being able to do soemthing along the lines of:
Code: Select all
Event("UseItem", "Brown Rock")
{
*command=msg %player% You look at the rock, it has a large crack in it. you throw it against another rock.
Chance =%75
*command=msg %player% it breaks open and there is nothing of interest.
Chance=%25
*command=msg %player% It breaks open and theres a Diamond inside!
*command=grantitem %player% 1 Diamond
}
would be quite useful for many types of worlds and for many different things.
Posted: Wed Jun 13, 2007 6:07 pm
by morbydvisns
oh nice i like that.
alot
Posted: Sun Jun 17, 2007 6:14 pm
by Rikku
this a code
Code: Select all
Event( "skill", "10" )
{
*command=setauth %player% 8
*command=grantkudos %player% 10
*command=grantcash %player% 1500
*command=grantitem %player% 1 Vehicle 10
*command=say %player% You are now a Knight Great Job! Relog for your new rank to show up!
*command=grantitem %player% 10 weap 2
*command=grantitem %player% 10 weap 3
}
is the skill 10 thing correct or what is it for a certain skill thing?
Posted: Sun Jun 17, 2007 8:58 pm
by VDZ
There is no "skill" event, and there won't ever be that exact event: it needs a condition to react to, a trigger.
"skill" would trigger again and again as long as you have the skill, which can't be what you want.
Instead, we'd need either a Timer event, that triggers once every X seconds/minutes, with a conditional statement checking if you've got the skill, or if you mean when the skill is learned, a SkillLearned event.
The rest of the code is fine, though.
Posted: Mon Jun 25, 2007 12:23 am
by Mit
as bongz has indicated elsewhere, conditionals, player variables, global server variables, user defined variables, sleep/delays in scripts and various methods for retrieving player data have been aded for the latest servers. Full details will follow in the next update of the world owners manual, but for now, heres an example of the sorta thing you can do..
Code: Select all
//----------------- Server Vars
$kServerCigarCount = 1
//------------------ Script constants
$kSpecialValue = 200
$kCigarSmokeDelay = 30 // Seconds
Event( "UseItem", "Cigars" )
{
if ( $PlayerTimeVar[1] < $gServerTime )
{
$gServerVar[$kServerCigarCount] = $gServerVar[$kServerCigarCount] + 1
$playerTimeVar[1] = $gServerTime + $kCigarSmokeDelay
*say %PLAYER% lights up....
Sleep(40) // 1/10ths of a second = 4second delay
*soundeffect 18
*effect %PLAYER% 9
*grantkudos %PLAYER% 1
*say %PLAYER% smoked a cigar ($gPlayerKudos kudos) - $gServerVar[ $kServerCigarCount ] cigars have been smoked
}
else
{
*msg %PLAYER% You can only smoke 1 cigar every $kCigarSmokeDelay seconds
CancelTransaction()
}
}
Event( "PlayerLogin", "" )
{
*msg %PLAYER% Welcome, %PLAYER%, to my special place
*msg %PLAYER% $gServerVar[ $kServerCigarCount ] cigars have been smoked here
}
Event( "&command", "help" )
{
*msg %PLAYER% Thank you, %PLAYER%, for trying the &help command. This command is no help.
}
Event( "UseItem", "Test Item" )
{
*say %PLAYER% produces the jive
*effect %PLAYER% 10
*soundeffect 19
*effect %PLAYER% 1
Sleep(15)
*effect %PLAYER% 5
*effect %PLAYER% 1
*soundeffect 20
Sleep(10)
*effect %PLAYER% 5
*soundeffect 21
Sleep(25)
*effect %PLAYER% 5
}
Oh and theres also a Rand() function, amongst other things :]
Posted: Tue Jun 26, 2007 12:00 pm
by zaroba
any chance on getting a variable whos value is input by the player?
Posted: Tue Jun 26, 2007 12:12 pm
by Jayecifer
lol old school q-basic..
CLS
INPUT X%
PRINT X%
Posted: Wed Jun 27, 2007 2:09 am
by zaroba
erm..this isen't old school basic.
we can only use commands that mit PUT in the game
Posted: Wed Jun 27, 2007 4:38 am
by morbydvisns
Posted: Wed Jun 27, 2007 11:57 am
by Jayecifer
zaroba wrote:erm..this isen't old school basic.
we can only use commands that mit PUT in the game
I know this isn't q-basic.
Posted: Wed Jun 27, 2007 10:11 pm
by zaroba
then what does input in basic have to do with the topic or even the question i posted?
Posted: Sat Jun 30, 2007 9:18 pm
by VDZ
With a Listen(Text) event, the possiblities would be endless.
Posted: Sat Jun 30, 2007 10:45 pm
by morbydvisns
there are &commands
event ( "&command", "help" )
{
}
Posted: Sun Jul 01, 2007 12:38 am
by Jayecifer
zaroba wrote:then what does input in basic have to do with the topic or even the question i posted?
Nothing,... I'm just being an unhelpful tard.