[SOLVED]Attempt to call a nil value

Place to get help with not working mods / modding interface.
CruWiT
Inserter
Inserter
Posts: 23
Joined: Wed Apr 17, 2019 6:22 pm
Contact:

[SOLVED]Attempt to call a nil value

Post by CruWiT »

I just test some code from https://lua-api.factorio.com/latest/
This is error when I try start new game.

Code: Select all

__Functionals__/control.lua:1: attempt to call a nil value
stack traceback:
	__Functionals__/control.lua:1: in main chunk
this is my control.lua;

Code: Select all

script.on_event
(
	defines.events.on_built_entity, 
	function(event)
		local yaratilan_entity = event.created_entity
		local oyuncu_index = event.player_index
		local esas_oyuncu = game.get_player(oyuncu_index)
		local item_stack = event.stack
		local item = event.item
		local taglar = event.tags
		
		if esas_oyuncu.character ~= nil then
			esas_oyuncu.character_running_speed_modifier = 0.9
			game.print("Fonksiyon basariyla calisti.")
		end
	end,
	{
		{
			filter = "type",
			type = "wall"
		},
		{
			filter = "vehicle",
			mode = "or",
		},
		{
			filter = "name",
			name = "small-lamp",
			mode = "or"
		}
	}
)
What's wrong here?

note: Game version is Factorio 1.1.34

edit: I have no idea what happened. But I'm reload game and try again new game. mod completely working. Maybe my first launch the version 1.1.34 is a problem I don't know but it's fine now.
Last edited by CruWiT on Fri May 28, 2021 10:42 am, edited 2 times in total.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3724
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Attempt to call a nil value

Post by DaveMcW »

Your control.lua code works for me. What other mods do you have installed?
CruWiT
Inserter
Inserter
Posts: 23
Joined: Wed Apr 17, 2019 6:22 pm
Contact:

Re: Attempt to call a nil value

Post by CruWiT »

DaveMcW wrote: Fri May 28, 2021 10:20 am Your control.lua code works for me. What other mods do you have installed?
nothing just use this mod.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3724
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Attempt to call a nil value

Post by DaveMcW »

Can you zip the mod and attach it to a post?
CruWiT
Inserter
Inserter
Posts: 23
Joined: Wed Apr 17, 2019 6:22 pm
Contact:

Re: Attempt to call a nil value

Post by CruWiT »

DaveMcW wrote: Fri May 28, 2021 10:38 am Can you zip the mod and attach it to a post?
Mod is work now thanks for try to help
DarkShadow44
Filter Inserter
Filter Inserter
Posts: 358
Joined: Thu Jun 01, 2017 12:05 pm
Contact:

Re: [SOLVED]Attempt to call a nil value

Post by DarkShadow44 »

For completeness it's always appreciated if you tell us what the problem was. You know, in case someone comes across this when googling. ;)
Post Reply

Return to “Modding help”