Page 1 of 1

trouble with a spawn script

Posted: Fri Nov 10, 2017 11:54 am
by Ememjr
i have a spawn script below, that i want to give an item to the player but it appears casted on is not working

the spawn is a weapon rack, i added an enity command Search Weapon Rack to the entity commands table
i added the entity command to the npc object primary entity

i have added the spawn script to the spawn_scripts table

when i search the rack i see the casting bar but it does not appear that the cast_on function is being called

i have no clue where to look for the issue, i turned on luadebug start but get no errors





Code: Select all

--[[
    Script Name    : SpawnScripts/IsleRefuge1/WeaponRack.lua
    Script Author  : EmemJr
    Script Date    : 2017.11.05
    Script Purpose : give out arche type bag of goodies
                   :
--]]



function spawn(NPC)

end

function respawn(NPC)
	spawn(NPC)
end

function casted_on(NPC, Spawn, Message)
	Say(Spawn, "This is me talking")
	SummonItem(Spawn, 707, 1)
end

Re: trouble with a spawn script

Posted: Fri Nov 10, 2017 12:30 pm
by Ememjr
ok so after racking my brain for hours i found that the entity table command field had to be in lower case in order for the casted_on in the script to fire