Thomas Die

  • Content Count

  • Joined

  • Last visited

Community Reputation

897 Excellent

About Thomas Die

  • Rank
    Senior Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. inst:RemoveTag("scarytoprey") --place this wherever the taggs go rabbit brain found in /scripts/brains/rabbitbrain rabbits and stuff brains I think are set to run away if it has the tag "scarytoprey" so taking it out should do that not sure tho so experiment. brain/THE_ANIMAL_NAMEbrain. will tell you about how things will work.
  2. Most code too doo with how mobs interact would be in scripts/brains/. Has the prefab name written under code you can check in there how to code works and probably how to change it.
  3. AddPlayerPostInit(function(inst) if not inst:HasTag("your player tagg") then return end inst:DoPeriodicTask(time between each function, function() --the code end) end)
  4. pretty much just have the code run whenever your skin changes but if you're lazy like me just have a periodic task run it
  5. inst.components.skinner.skin_name this was from a few months ago but this is where your skin name is
  6. Who's Freya and how have you copied of the code and can you show me it.
  7. Ngl I think you might have to reconsider the coding, I'm pretty sure this is absurdely effort but I think DarkXero made code for this if it still works. I'm happily willing for someone to tell me otherwise tho.
  8. Uhm don't tell anyone but do you see that mini function in the brackets can you add a little end to end it off :] Probably my woopsie. This thing
  9. local drop_rate_chance = 0.5 --lower equals higher chance drop local drop_rate_max_chance = 10 --how many items unitll it reaches a 100% rate local drop_rate_item = 'insert_prefab_which_increases_drop_rate' local drop_item = 'Item_which_will_be_dropped' --reused from wortox code line 175 local function GetStackSize(item) return item.components.stackable ~= nil and item.components.stackable:StackSize() or 1 end --reused from wortox code line 183-189 local function AmountOfItem(inst) local item = inst.components.inventory:FindItems(function(i)return i.prefab== drop_rate_item) --will be explained in a spoiler below local count = 0 for i, v in ipairs(item) do count = count + GetStackSize(v) end return count end inst:ListenForEvent("onattackother", function(inst, data) = target you attacked, data.weapon = weapon you hit them with, data.projectile = object that you hit them with , data.stimuli = thing that you hit --written on line 882 in scripts/components/combat if (math.clamp(math.random() + (AmountOfItem(inst) / drop_rate_max_chance) , 0,1)) > drop_rate_chance then SpawnPrefab(drop_item).Transform:SetPosition( end end) This code should work but it's untested i'll explain the method in the spoilers below if you'd like to change any code just ask but i'll only explain how you should do it Counting The amount of items Calculating the chance of drop on hit kinda burnt out so reply if you're suck and i'll replay tommroow
  10. Oh sorry put just inst maybe instead of self.inst
  11. Before anything server related For a player file inside common_postinit
  12. In terms of code or art, if you're talking about code i explained prior for art just use text tool to extract an existing image or use ktool krane to extract and replace, like i did for the custom badges.