This is a casino scrip that was originally scripted by Orzeleagle. I converted it into a mod, but was edited by Cykotitan. So credits goes to the original scripter, and Cyko.
Make a new file in the Mods folder called casino.xml and add this.
How To Configure:
Using a map editor, place a lever (or any item of your choice) and change the uniqueid to 5885.
Now change the coordinates on this line
to the coordinates where you place your bets.
Easy and simple
Original Script
This mod was tested using TFS 0.3.6!
Make a new file in the Mods folder called casino.xml and add this.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Casino lever" enabled="yes">
<action uniqueid="5885" event="script"><![CDATA[
local pos = {x=1241, y=768, z=8, stackpos = 255}
local cash = 2160
local t = {
[{1, 55}] = 0,
[{56, 90}] = 2,
[{91, 100}] = 3
}
local a, b = getItemInfo(cash).name, getItemInfo(cash).plural
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = getThingfromPos(pos)
if v.itemid ~= cash then
return doCreatureSay(cid, 'You can only use ' .. b .. '.', TALKTYPE_ORANGE_1, false, cid)
end
local r = math.random(100)
for i, k in pairs(t) do
if r >= i[1] and r <= i[2] then
doRemoveItem(v.uid)
if k < 1 then
doCreatureSay(cid, 'You lost ' .. v.type .. ' ' .. (v.type == 1 and a or b) .. ' :(', TALKTYPE_ORANGE_1, false, cid)
doSendMagicEffect(pos, CONST_ME_POFF)
else
doCreatureSay(cid, 'You won ' .. v.type * k .. ' ' .. (v.type == 1 and a or b) .. ' :)', TALKTYPE_ORANGE_1, false, cid)
doCreateItem(cash, v.type * k, pos)
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
doSendMagicEffect(toPosition, CONST_ME_SOUND_YELLOW)
end
return true
end
end
end
]]></action>
</mod>
How To Configure:
Using a map editor, place a lever (or any item of your choice) and change the uniqueid to 5885.
Now change the coordinates on this line
Code:
local pos = {x=498, y=541, z=9, stackpos = 255}
Easy and simple
Original Script
This mod was tested using TFS 0.3.6!
Last edited: