Jump to content

-snowman-

Members
  • Posts

    4
  • Joined

  • Last visited

-snowman-'s Achievements

Vic

Vic (3/54)

0

Reputation

  1. thanks man im new to lua so i didnt see that error
  2. 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
  3. yea that worked didnt see my mistake there but ty
  4. i was just trying my first script to plant a pot and after a time it destroys and spawns weed in its place but i cant get it to work here is the code, any help would be good function plantWeedForPlayer(thePlayer, command) local x,y,z = getElementPosition(thePlayer) x = x + 1 z = z - 0.5 local weed = createObject(2241,x,y,z) setTimer(destroyElement, 5000, 1, weed ) addEventHandler ("onElementDestroy", weed, growWeed) end addCommandHandler("plantseeds", plantWeedForPlayer) function growWeed (thePlayer) local x, y, z = getElementPosition ( weed ) grass = createObject ( 3409, x, y, z ) z = z - 1 end
×
×
  • Create New...