GanJaRuleZ Posted December 23, 2011 Share Posted December 23, 2011 (edited) How to make a roll script like in DDC , i bet that many of you wanted it So lets stars THIS SCRIPT ISN'T MINE! restriction = {} --We will need to add restrictions addCommandHandler("roll", --We add a commandHandler here function(thePlayer) --We start a new function end -- We end the function ) -- We close the commandHandler After we will need to get the player restriction = {} --We will need to add restrictions addCommandHandler("roll", --We add a commandHandler here function(thePlayer) --We start a new function local playerName = getPlayerName(thePlayer) -- We will get the player if restriction[playerName] then -- We get , if the player has restricion to Roll else outputChatBox("You have to wait 30 seconds", thePlayer, 255, 0, 0) -- We print in chat that he needs to wait 30 secs else restriction[playerName] = true -- If he isnt restrictionated setTimer(restrictionEnd, 30000, 1, playerName) -- 30 Secs to the restriction to end randomroll = math.random(1, 3000) -- It writes a number between 1 and 3000 ( you can edit it ) roller = math.random(1, 4) -- It writes a number between 1 and 4 ( not recomended to edit ) if roller == 1 then -- If its 1 givePlayerMoney(thePlayer, randomroll) -- It gives the player money outputChatBox(playerName .. ' roll and wins ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) -- It writes in chat the win elseif roller == 2 then -- If its 2 takePlayerMoney(thePlayer, randomroll) -- It takes the player money outputChatBox(playerName .. ' roll and losses ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) -- It writes in the chat the lose elseif roller == 3 then -- If its 3 setPlayerMuted(thePlayer, true) --It mutes it setTimer(setPlayerMuted, 30000, 1, thePlayer, false) -- We determine the time outputChatBox(playerName .. ' roll and is now muted !', getRootElement(), 255, 255, 0) -- It writes in the chat the mute elseif roller == 4 then -- If its 4 setSkyGradient(math.random(1, 255) ,math.random(1, 255) ,math.random(1, 255) ,math.random(1, 255) ,math.random(1, 255) ,math.random(1, 255)) -- Then it changes the sky colour outputChatBox(playerName .. ' roll and is now changed the sky colour !', getRootElement(), 255, 255, 0) -- It writes the change in the chat end -- End end -- End end -- We end the function ) -- We close the commandHandler function restrictionEnd(playerName) restriction[playerName] = nil end Edited December 29, 2011 by Guest Link to comment
Castillo Posted December 23, 2011 Share Posted December 23, 2011 You didn't make that, you should give credits to the real author. P.S: There's something missing, maybe the "restrictionEnd" function? . Link to comment
Unknown76 Posted December 23, 2011 Share Posted December 23, 2011 (edited) Dirty thinking, script should be better restructured and setTimer(restrictionEnd, 30000, 1, playerName) ? Edited December 26, 2011 by Guest Link to comment
GanJaRuleZ Posted December 27, 2011 Author Share Posted December 27, 2011 1. I didn't wrote somewhere that that is my script. 2. I found it accidentaly on my friend's computer ( via TeamViewer ) , so i don't know to who to give the credits @QuantumZ : That is to restrict the player to roll , 30000 = 30 sec , so he has to wait 30 secs to roll another time @Solidsnake14: Yeah i forgot something , thx Link to comment
Aibo Posted December 27, 2011 Share Posted December 27, 2011 1. I didn't wrote somewhere that that is my script.2. I found it accidentaly on my friend's computer ( via TeamViewer ) , so i don't know to who to give the credits yet you've decided to post it here as a tutorial? good grief. Link to comment
Unknown76 Posted December 28, 2011 Share Posted December 28, 2011 1. I didn't wrote somewhere that that is my script.2. I found it accidentaly on my friend's computer ( via TeamViewer ) , so i don't know to who to give the credits @QuantumZ : That is to restrict the player to roll , 30000 = 30 sec , so he has to wait 30 secs to roll another time @Solidsnake14: Yeah i forgot something , thx You didn't get my point above, i was highlighting the word in bold, I understood what function does. Link to comment
Xeno Posted December 28, 2011 Share Posted December 28, 2011 You can tell its not him because the English is different in the --'s.... Lol. Link to comment
GanJaRuleZ Posted December 29, 2011 Author Share Posted December 29, 2011 I writed the --'s But hopeless , i see that some guys , don't understand that i didn't claimed as my own , i don't know his name on this forum , that's why i don't put credits there , anyway if anyone wants to talk to him , just pm me Link to comment
Xeno Posted December 29, 2011 Share Posted December 29, 2011 You DID claim it as your own or you wouldn't of posted it without saying "I didn't make this" Link to comment
GanJaRuleZ Posted December 29, 2011 Author Share Posted December 29, 2011 But i don't wrote that is mine... I edited it , now i don't want to have argues with nobody on this forum .. So please just ONTOPIC .. Link to comment
Otto Posted December 30, 2011 Share Posted December 30, 2011 Stop fighting! We know this is not your script. Right? Please next time teach with your own scripts, I'm learning and I can't learn on this way. Link to comment
GanJaRuleZ Posted December 30, 2011 Author Share Posted December 30, 2011 Stop fighting! We know this is not your script. Right? Please next time teach with your own scripts, I'm learning and I can't learn on this way. +1 , Finally someone ... Link to comment
Xeno Posted December 30, 2011 Share Posted December 30, 2011 .. So please just ONTOPIC .. Contradicted yourself.............................. Link to comment
nik3231 Posted January 1, 2012 Share Posted January 1, 2012 While in-game you do "/roll" ? Link to comment
Perfect Posted January 18, 2013 Share Posted January 18, 2013 nice tutorial i just understand something in which i was confused . Thnx Link to comment
GeForce. Posted January 22, 2013 Share Posted January 22, 2013 As you all said nice TUT it need some fixs but it still great Link to comment
Recommended Posts