mxHanks Posted January 28, 2023 Share Posted January 28, 2023 I'm trying to make characters act slowly when their hungry-value < 10% I find that a tag named "hungrybuilder" can change character's speed when they are building,but I want to change the speed when they do everything! How can I do!(Maybee I can see 卵石路's code because characters runs quickly when on it) This is my code now: -- modmain.lua ... AddPlayerPostInit(function(inst) if inst.components and inst.components.hunger then inst:ListenForEvent("hungerdelta", function (inst, data) if data then --[[ 饥饿值小于10%时减慢工作速度 ]] if data.newpercent < 0.1 then inst:AddTag("hungrybuilder") elseif data.newpercent > 0.1 and inst:HasTag("hungrybuilder") then inst:RemoveTag("hungrybuilder") end end end) end end) ... Thank you! My English is not good so I send it again in Chinese 我想把人物在饥饿值低于10%的时候做任何事情的速度都变慢,但是我只找到了能让建造速度面板的tag"hungrybuilder"。 Link to comment https://forums.kleientertainment.com/forums/topic/145799-%E6%80%8E%E4%B9%88%E6%94%B9%E9%80%9F%E5%BA%A6%EF%BC%9Fabout-change-speed-every-action/ Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now