Forkz
Well-Known Member
- Joined
- Jun 29, 2020
- Messages
- 380
- Solutions
- 1
- Reaction score
- 89
Hi Otlanders,
I'm not able to close the ends, I'm a beginner on the lua.
data/actions/scripts/jail/jailkey.lua:31: `end' expected (to close `if' at line 11) near `else'
I'm not able to close the ends, I'm a beginner on the lua.
Lua:
function onUse(cid, item, frompos, item2, topos)
jailroom = {x=1031, y=1034, z=8}
jailtime = 10
time = getPlayerStorageValue(cid,1533)
now = os.time()
access = 6
access2 = 2
if getPlayerAccess(cid) >= access then
if getPlayerName(item2.uid) == getPlayerName(cid) then
doPlayerSendTextMessage(cid,22,""..jailtime.." seconds of prison system.")
setPlayerStorageValue(cid,1533,jailtime)
doPlayerSay(cid,"/B Jail System: The player "..getPlayerName(item2.uid).." was arrested for " ..jailtime.." seconds.", 16)
end
if getPlayerAccess(item2.uid) < access2 then
if getPlayerStorageValue(item2.uid,1444) == -1 then
doPlayerSendTextMessage(item2.uid,22,"You are arrested for "..time.." seconds! Any word that you say now can be used against you later.")
doTeleportThing(item2.uid,jailroom)
setPlayerStorageValue(item2.uid,1445,time)
setPlayerStorageValue(item2.uid,1444,now)
else
doPlayerSendTextMessage(cid,22,""..getPlayerName(item2.uid).." is already arrested.")
end
else
doPlayerSendCancel(cid,"You cannot make this player a prisioner.")
end
else
doPlayerSendCancel(cid,"You can only use this rune on a person.")
else
doPlayerSendCancel(cid,"You do not have the needed access to use this rune.")
end
return 1
end
data/actions/scripts/jail/jailkey.lua:31: `end' expected (to close `if' at line 11) near `else'