Jump to content

roll script.help me pls


raulrobi

Recommended Posts

Posted

I have makd a roll script

function roll(player.comd) local roll =

math random(1.6) if roll = 1 then u won blablabla

if roll = 2 u lost blablabla

if roll = 3 u r muted

if roll = 4 u win blablabla

addCommandHandler(("roll",roll)

it doesent work.CAN ANYONE REPAIR IT PLS.

Posted

lol

function roll(player.comd)
local roll = math random(1.6)
if roll = 1 then u won blablabla
elseif roll = 2 then u lost blablabla
elseif roll = 3 then u r muted
elseif roll = 4 then u win blablabla
end
end
addCommandHandler(("roll",roll)

Posted

omg

teach yourself how top script.. this doesnt make sense

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
function roll(player,command) -- a comma between parameters not a decimal point
local rand = math.random(1,6) -- math.random (with a decimal point and also a comma to separate the parameters of math.random)
if rand == 1 then -- == instead of = when comparing
-- do something
elseif rand == 2 then
-- do something else
elseif rand == 3 then
-- do something else
elseif rand == 4 then
-- do something else
elseif rand == 5 then
-- do something else
else
-- do something else
end -- end for the if in line 4
end -- end of the function
addCommandHandler("roll",roll) -- add the command handler

Posted (edited)
function rolldice(player,comd)
local roll = math.random(1,4)
if roll == 1 then outputChatBox("u won blablabla")
elseif roll == 2 then outputChatBox("u lost blablabla")
elseif roll == 3 then setPlayerMuted(source,true); setTimer(setPlayerMuted,1,30000,player,false) 
elseif roll == 4 then outputChatBox("u win blablabla")
end
end
addCommandHandler("roll",rolldice)

Edited by Guest
Posted
function roll(player,comd)
local roll = math.random(1,4)
if roll == 1 then outputChatBox("u won blablabla")
elseif roll == 2 then outputChatBox("u lost blablabla")
elseif roll == 3 then setPlayerMuted(source,true); setTimer(function() setPlayerMuted(source,false) end,1,30000) 
elseif roll == 4 then outputChatBox("u win blablabla")
end
end
addCommandHandler("roll",roll)

I do not recommend calling variables the same names as functions.

Posted

you.. posted.. 400 bytes script.. on.. RAPIDSHARE?

I'm sure, that nobody will care..

post your code on forums..

or use pastebin.com

or something, but not RAPIDSHARE!

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
you.. posted.. 400 bytes script.. on.. RAPIDSHARE?

I'm sure, that nobody will care..

post your code on forums..

or use pastebin.com

or something, but not RAPIDSHARE!

this is his code,

addCommandHandler("roll",rolldice)
function rolldice(player,comd)
local roll = math.random(1,4)
if roll == 1 then outputChatBox("u won")
elseif roll == 2 then outputChatBox("u lost")
elseif roll == 3 then setPlayerMuted(source,true); setTimer(function() setPlayerMuted(source,false) end,1,30000) 
elseif roll == 4 then outputChatBox("u win")
end
end

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

cookie2,

when you are adding event/command handler, the handler function MUST be defined BEFORE adding handler..

in other words:

if you copy ready script from here, don't change it if you don't know what are you doing

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

this doesnt work (i open notepad and paste in it then i do save as then i type roll.lua)

function roll(player,comd)

local roll = math.random(1,4)

if roll == 1 then outputChatBox("u won blablabla")

elseif roll == 2 then outputChatBox("u lost blablabla")

elseif roll == 3 then setPlayerMuted(source,true); setTimer(function() setPlayerMuted(source,false) end,1,30000)

elseif roll == 4 then outputChatBox("u win blablabla")

addCommandHandler("roll",roll)

end

end

Posted

COOKIE FFS!! Use that damn [ LUA] tags!

and now:

go to the 4th post of this topic.

copy and paste and NOTHING MORE. And it will be fine..

Every post you are just messing the script, i dont know why? Maybe you tell me?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

it would be much easier for you if you'd have any idea about programming at all.

this code is already a bit messy, you're just messing it up even more:

addCommandHandler("roll",
function(player,comd)
local roll = math.random(1,4)
if roll == 1 then outputChatBox("u won blablabla", player) -- no player was specified, message'd be shown to all
elseif roll == 2 then outputChatBox("u lost blablabla", player)
elseif roll == 3 then 
setPlayerMuted(player, true) -- as i recall, "source" is not passed by command handler, use "player", but i may be wrong
setTimer(setPlayerMuted, 30000, 1, player, false) -- what's more, setTimer parameters were messed up, 30000 executions with 1ms interval.
elseif roll == 4 then outputChatBox("u win blablabla", player)
end
end 
)

?

Posted

your tryings are worthless, xbost..

he will edit that script :P

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Seriously, somebody need to ban the COOKIE12...

http://www.sincitygaming.net - The next generation of gaming!

SinCity Gaming | UltiRace 24/7 - 188.165.199.162:22003

SinCity Gaming | Roleplay Gaming - Beta soon!

SinCity Gaming | Zombie Mode + - 188.165.199.162:22005

Instead of using ip: 188.165.199.162 you can use: sincitygaming.net

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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