Jump to content

Recommended Posts

Well, thanks to Peter's tournament mod, I started to create a sprinter mod which allows players to run pressing SHIFT. Mod works perfectly for me but when a friend tries to join, it gives an error like 'Missing Mods'. Here are my codes. What should I edit?

 

Modmain.lua:

local TheNet = GLOBAL.TheNetAddReplicableComponent( "sprinter" )function PlayerComponents( inst )	inst:AddComponent("sprinter")	inst.components.health.RecalculatePenalty = function(forceupdatewidget) end	endAddPlayerPostInit( PlayerComponents )GLOBAL.TUNING.SPRINT_MULT = 1.5GLOBAL.TUNING.SPRINT_HUNGER_MULT = 8GLOBAL.AddModRPCHandler( "run", "StartSprint", 	function(inst)        inst.components.sprinter.is_sprinting = true    end )GLOBAL.AddModRPCHandler( "run", "StopSprint", 	function(inst)        inst.components.sprinter.is_sprinting = false    end )

modinfo:

dst_compatible = truereign_of_giants_compatible = trueall_clients_require_mod = trueclient_only_mod = falseicon_atlas = "modicon.xml"icon = "modicon.tex"--This lets people search for servers with this mod by these tagsserver_filter_tags = {"run"}--configuration_options = {}--[[Special Thanks To:Klei Entertainment--]]
Link to comment
https://forums.kleientertainment.com/forums/topic/54314-sprinter-mod-error/
Share on other sites

Did you redownload it from there yourself? If I understand correctly, the server tells joiners what to get using the mod's workshop ID, so...there's that.
Alternatively, for testing purposes, it should work if you send the file to them and they put it in their mod folder.

@CanTotu, you need the following code before any components.

if not TheWorld.ismastersim then    return instend 

EXAMPLE:

function PlayerComponents( inst )    if not TheWorld.ismastersim then        return inst    end    inst:AddComponent("sprinter")    inst.components.health.RecalculatePenalty = function(forceupdatewidget) end   endAddPlayerPostInit( PlayerComponents )
Edited by Kzisor

 

@CanTotu, you need the following code before any components.

if not TheWorld.ismastersim then    return instend 

EXAMPLE:

function PlayerComponents( inst )    if not TheWorld.ismastersim then        return inst    end    inst:AddComponent("sprinter")    inst.components.health.RecalculatePenalty = function(forceupdatewidget) end   endAddPlayerPostInit( PlayerComponents )

Thanks. I'll try that.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...