• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Construction Kits[Help]

  • Thread starter Thread starter 53701688
  • Start date Start date
5

53701688

Guest
Hello I need Urgent help with my construction kits script i want that only can open in ur house and not in ur bp or on the ground out of the house i will add down here my scripts!

Code:
function onUse(cid, item, frompos, item2, topos)
	if frompos.x == 65535 then
		doPlayerSendCancel(cid, "Put the construction kit in Your House First")
		return 1
	end
	doSendMagicEffect(topos,2)
	if item.itemid == 3901 then
		doTransformItem(item.uid,1652)
	elseif item.itemid == 3902 then
		doTransformItem(item.uid,1658)
	elseif item.itemid == 3903 then
		doTransformItem(item.uid,1666)
	elseif item.itemid == 3904 then
		doTransformItem(item.uid,1670)
	elseif item.itemid == 3905 then
		doTransformItem(item.uid,3813)
	elseif item.itemid == 3906 then
		doTransformItem(item.uid,3817)
	elseif item.itemid == 3908 then
		doTransformItem(item.uid,2602)
	elseif item.itemid == 3909 then
		doTransformItem(item.uid,1614)
	elseif item.itemid == 3910 then
		doTransformItem(item.uid,1615)
	elseif item.itemid == 3911 then
		doTransformItem(item.uid,1616)
	elseif item.itemid == 3912 then
		doTransformItem(item.uid,1619)
	elseif item.itemid == 3913 then
		doTransformItem(item.uid,3805)
	elseif item.itemid == 3914 then
		doTransformItem(item.uid,3807)
	elseif item.itemid == 3917 then
		doTransformItem(item.uid,2084)
	elseif item.itemid == 3918 then
		doTransformItem(item.uid,2095)
	elseif item.itemid == 3919 then
		doTransformItem(item.uid,3809)
	elseif item.itemid == 3926 then
		doTransformItem(item.uid,2080)
	elseif item.itemid == 3927 then
		doTransformItem(item.uid,2098)
	elseif item.itemid == 3928 then
		doTransformItem(item.uid,2104)
	elseif item.itemid == 3929 then
		doTransformItem(item.uid,2101)
	elseif item.itemid == 3931 then
		doTransformItem(item.uid,2105)
	elseif item.itemid == 3932 then
        doTransformItem(item.uid,1724)
	elseif item.itemid == 3933 then
		doTransformItem(item.uid,1728)
	elseif item.itemid == 3935 then
		doTransformItem(item.uid,1775)
	elseif item.itemid == 3937 then
		doTransformItem(item.uid,2064)
	elseif item.itemid == 3907 then
        doTransformItem(item.uid,3821)
	elseif item.itemid == 3915 then
		doTransformItem(item.uid,1738)
	elseif item.itemid == 3920 then
		doTransformItem(item.uid,3811)
	elseif item.itemid == 3921 then
		doTransformItem(item.uid,1716)
	elseif item.itemid == 3923 then
		doTransformItem(item.uid,1774)
	elseif item.itemid == 3934 then
		doTransformItem(item.uid,1732)
	elseif item.itemid == 3936 then
		doTransformItem(item.uid,3832)
	elseif item.itemid == 3938 then
		doTransformItem(item.uid,1750)
	else
		return 0
	end
	return 1
end

Already Big ty for the guy who helps me u will get rep++
 
Solution
LUA:
local t = {[3901] = 1652, [3902] = 1658, [3903] = 1666, [3904] = 1670, [3905] = 3813, [3906] = 3817, [3907] = 3821, [3908] = 2602, [3909] = 1614, [3910] = 1615, [3911] = 1616, [3912] = 1619, [3913] = 3805, [3914] = 3807, [3915] = 1738, [3917] = 2084, [3918] = 2095, [3919] = 3809, [3920] = 3811, [3921] = 1716, [3923] = 1774, [3926] = 2080, [3927] = 2098, [3928] = 2104, [3929] = 2101, [3931] = 2105, [3932] = 1724, [3933] = 1728, [3934] = 1732, [3935] = 1775, [3936] = 3832, [3937] = 2064, [3938] = 1750}

function onUse(cid, item, frompos, item2, topos)
	if frompos.x == 65535 or getTileHouseInfo(frompos) == 0 then
		doSendMagicEffect(frompos, 2)
		doPlayerSendCancel(cid, "Put the construction kit in your house first.")
	elseif t[item.itemid] then
		doSendMagicEffect(frompos, 3)
		doTransformItem(item.uid...
LUA:
local t = {[3901] = 1652, [3902] = 1658, [3903] = 1666, [3904] = 1670, [3905] = 3813, [3906] = 3817, [3907] = 3821, [3908] = 2602, [3909] = 1614, [3910] = 1615, [3911] = 1616, [3912] = 1619, [3913] = 3805, [3914] = 3807, [3915] = 1738, [3917] = 2084, [3918] = 2095, [3919] = 3809, [3920] = 3811, [3921] = 1716, [3923] = 1774, [3926] = 2080, [3927] = 2098, [3928] = 2104, [3929] = 2101, [3931] = 2105, [3932] = 1724, [3933] = 1728, [3934] = 1732, [3935] = 1775, [3936] = 3832, [3937] = 2064, [3938] = 1750}

function onUse(cid, item, frompos, item2, topos)
	if frompos.x == 65535 or getTileHouseInfo(frompos) == 0 then
		doSendMagicEffect(frompos, 2)
		doPlayerSendCancel(cid, "Put the construction kit in your house first.")
	elseif t[item.itemid] then
		doSendMagicEffect(frompos, 3)
		doTransformItem(item.uid, t[item.itemid])
	else
		return 0
	end
	return 1
end
 
Solution
LUA:
local t = {[3901] = 1652, [3902] = 1658, [3903] = 1666, [3904] = 1670, [3905] = 3813, [3906] = 3817, [3907] = 3821, [3908] = 2602, [3909] = 1614, [3910] = 1615, [3911] = 1616, [3912] = 1619, [3913] = 3805, [3914] = 3807, [3915] = 1738, [3917] = 2084, [3918] = 2095, [3919] = 3809, [3920] = 3811, [3921] = 1716, [3923] = 1774, [3926] = 2080, [3927] = 2098, [3928] = 2104, [3929] = 2101, [3931] = 2105, [3932] = 1724, [3933] = 1728, [3934] = 1732, [3935] = 1775, [3936] = 3832, [3937] = 2064, [3938] = 1750}

function onUse(cid, item, frompos, item2, topos)
    if frompos.x == 65535 or getTileHouseInfo(frompos) == 0 then
        doSendMagicEffect(frompos, 2)
        doPlayerSendCancel(cid, "Put the construction kit in your house first.")
    elseif t[item.itemid] then
        doSendMagicEffect(frompos, 3)
        doTransformItem(item.uid, t[item.itemid])
    else
        return 0
    end
    return 1
end


HAVE VERSION 8.40?
 
Back
Top