Search the Community
Showing results for tags 'solved!'.
Found 4 results
-
I am trying to make a character that gains sanity when around goats and I found a code, and it worked. But I want to increase the sanity gain, yet I can't really understand the codes so I don't know what to change. local function sanityfn(inst) local x, y, z = inst.Transform:GetWorldPosition() local delta = 0 local ents = TheSim:FindEntities(x, y, z, 20, {"lightninggoat"}) for k, v in pairs(ents) do if v ~= inst then local distsq = math.max(inst:GetDistanceSqToInst(v), 1) -- Handle Sanity if distsq < 50 then delta = .2 elseif distsq < 200 then delta = .1 end end end return delta end What I mainly don't know are; delta, distsq and k, v meanings.. Thanks in advance ^^
-
I know this is a repost from last week, but I am getting desperate here. Basically, I changed the weapon and swap_weapon sprites for a handslot item in my Mod, but the sprite appears invisible while eqquiped and on ground. I tried to look for help on other forum posts, but nothing has worked. The item in particular is titled "sanityspear", even though the item "sanitysword" has this problem too (however I think the sword will have the same solution). Please help me with this, as I want to go back to working on updating my mod as fast as possible. I have tried posting this issue on reddit and the Don't Starve forum, but I haven't gotten any help from those forums either. I am willing to get help over a discord call if you want me to, just please dm me via my forum profile about it. Any kind of help would be appreciated.Wayne_The_Experiment-1.2.zip
-
I'm trying to check if is player first spawn for do some things for Client and server. I already can do for Server, but I don't know how to do this for client. I think that when the function is executed by the server, it will not be executed by the client. When Cliente_Side is outslide OnNewSpawn function, is executed every time a player join server. English is not my main language so may have translation erros. My code looks like: local OnPlayerSpawn = function(player) player.prev_OnNewSpawn = player.OnNewSpawn player.OnNewSpawn = function() if SERVER_SIDE then --do Things in server_side end if CLIENT_SIDE then --do Things in client_side end if player.prev_OnNewSpawn ~= nil then player:prev_OnNewSpawn() player.prev_OnNewSpawn = nil end end end local function OnPlayerPostInit(player) OnPlayerSpawn(player) end AddPlayerPostInit(OnPlayerPostInit) This must be something simple, but I'm missing it.
-
Not sure why, but my autocompiler doesn't seem to be able to compile my character's animations (I used the Extended Sample Template), I have tried a bunch of different solutions I found here on the forums (Making sure I have all body parts, making sure everything is named properly, etc.) but for some odd reason I keep getting an error when trying to compile the animations so I can actually see my character in game. I would totally appreciate some help with this.