hi again im tryin to add line that checks if the player has seeds and if they dont to not let them plant the line knows i dont have the item and send me the message but it still plants, how would i stop it from planting if player has not got the item
function plantWeedForPlayer( thePlayer, command )
if not(exports.global:hasItem(thePlayer, 49)) then
outputChatBox("You need seeds to plant.", thePlayer, 255, 0, 0)
local x,y,z = getElementPosition( thePlayer )
x = x + 1
z = z - 0.5
local weed = createObject( 2241,x,y,z )
setTimer( destroyElement, 1440000, 1, weed )
addEventHandler ("onElementDestroy", weed, growWeed)
end
end
addCommandHandler( "plantseeds", plantWeedForPlayer )
function growWeed ( )
local x, y, z = getElementPosition ( source )
z = z - 1
grass = createObject ( 3409, x, y, z )
end