Jump to content

kerbholz

Member
  • Posts

    29
  • Joined

  • Last visited

Community Answers

  1. kerbholz's post in Recipe That Spawns A Random Item was marked as the answer   
    Shouldn't it be
    if SpiffoNumber == 1 then...?? Double signs? Single equal sign assigns a value, use double equal signs in if loops. Also, print() your random number to see its value.
     
    Edit:
    Here's a little function that will spawn 5 Spiffos and print a random number to the console:
    local function AddSpiffo(_keyPressed)    local key = _keyPressed;    local numberOfItems = 5;    if tostring(key) == tostring(Keyboard.KEY_M) then        local player = getSpecificPlayer(0);        local inventory = player:getInventory();                for loopCount = 1, numberOfItems do            local SpiffoNumber = ZombRand(3) +1;            print("*** Spiffo" .. SpiffoNumber);            inventory:AddItem("Base.Spiffo");        end    endend-- AnyKeyPressEvents.OnKeyPressed.Add(AddSpiffo);Press M ingame to spawn the Spiffos.
  2. kerbholz's post in A Mug of Water and ReplaceOnUse was marked as the answer   
    Finally solved this by changing my recipe to destroy the WaterMug:
     
×
×
  • Create New...