Still dont understand what you just said.
But hey its kinda confirmed that we will get UDP similar remotes that are not ordered or reliable so faster packets for everyone!
Still dont understand what you just said.
But hey its kinda confirmed that we will get UDP similar remotes that are not ordered or reliable so faster packets for everyone!
Unfortunately due to limitations of roblox itself its practically impossible to make a good OOP system with metatables.
My original workarround was this:
function CTool:__SetOwner(Player)
if CTool.InventoryRecords[Player.UserId] then
self.Owner = Player
CTool.InventoryRecords[Player.UserId].Backpack[self.ID] = self
-- Run exclusive code to the Local Player
if Player == LocalPlayer then
CTool.OnCToolOwnershipToLocalPlayer:Fire(self)
end
else
error("Inventory not found")
end
end
-- Sets a CTool's Owner to the given Player
function CTool:SetOwner(Player)
local ClassMetatable = getmetatable(self)
while ClassMetatable do
if ClassMetatable and rawget(ClassMetatable, '__SetOwner') then
ClassMetatable.__SetOwner(self, Player)
end
ClassMetatable = getmetatable(ClassMetatable)
end
end
But even if I use this gross workarround theres another thing, if the conditions of one function are not met it will still run the next one after it meaning you have to add the checks of the previous function to the new one manually so pretty much theres no way to make this fast and pretty.
If only there was a way to add code into a function so it would run the original code and then the class’s code so I guess im going back to making custom functions for the classes that get called from the top function or using events that trigger the class’s functions.
I just dont think roblox is designed for custom OOP sometimes, anyways yeah hope you guys are not too annoyed that the next update is taken long but here’s the confirmed things for the next patch.
Update V1.2.0
Sorry this update took a month to make, I lost my motivation since I had come into a pretty hard to solve roadblock, but found out that OOP on roblox has its limitations mainly with functon inheritance so I resorted to using events, With all that said heres the update.
Report to me any bugs please as I always mess something up even when I test things as much as possible.
How do I make a tool with this? Don’t really get it
Ok so the way it works is like this, Once you setup the mod, You basically use :GetMod() to access the mods contents on the “ClientInventory” mod, Then you will go to it’s Objects Table where all object classes get stored, In this case CTool
So you do
local ServerInventory = ServerMods:GetMod("servermods","ServerInventory")
local CTool = ServerInventory.Objects.CTool
Then once that’s done you can create a new CTool by doing
local NewCTool = CTool.new()
Then hook up a function to the Equipped Event so you can trigger something upon being equipped
NewCTool.Equipped:Connect(function(State)
if State == true then
else
end
end)
Keep In mind the event returns true upon being Equipped, and false when unequipped
Once that’s done you can set it’s owner by doing
NewCTool:SetOwner(Player, Replicate)
I gave dev’s as much freedom so you can even choose to not replicate the Ownership to the player if you want to for whatever reason.
I still don’t get it, I copied these 2 module scripts and renamed them, which didn’t really add a new tool
I see the default CTool but there is no obvious/intuitive way to replicate the example you have, the boiler plate code you gave me don’t know where to put it either, my background with chickynoid is watching the seminar and having a surface level look over the code nothing much if that helps.
I dont really understand your issue here, Be more specific.
Also do not rename the modules as I am sure that would break the system.
And make sure you also installed the Server and Client script from the mod’s place file since its forked to process custom commands.
Feel free to keep replying, I love replying to comments it makes my day.
My issue is that I don’t know how to add a tool can you explain in detail?
EDIT: I assumed this worked like the normal way a roblox backpack works (because of the similarities) but it doesn’t, which is whats confusing me about this
What do you exactly mean by adding a tool?
I mean its literally on the first reply
local NewCTool = CTool.new()
Be aware that this uses Object Orientated Programming.
Here is something I tried: I put this in a module script, in my mods
local module = {}
-- Services
local ReplicatedFirst = game:GetService("ReplicatedFirst")
-- Mods
local ServerMods = require(ReplicatedFirst.Packages.Chickynoid.Server.ServerMods)
local ServerInventory = ServerMods:GetMod("servermods","ServerInventory")
local CTool = ServerInventory.Objects.CTool
local NewCTool = CTool.new()
NewCTool.Equipped:Connect(function(State)
if State == true then
else
end
end)
return module
Good now just do NewCTool:SetOwner(Player, Replicate), also do not put the code inside a module siince its not gonna run, you need to use a server script or put it inside a module’s function and then call it from somewhere else.
and it will appear on the player’s inventory.
However a better aproach is to create a new class using the classes folder and putting there a new module script with the functions a class would need, that way you can just call the class’s constructor function and make it automatically hook your functions to the tool upon being created
I left a WIP class in there called sword so you can take a look at how it works, again ask me any other questions.
Oh I see, thought the module scripts got ran automatically like in the knit framework
i’m new to chickynoid, can you help me a little bit on how i can add a model to the tool or if you are going to make a function for that ?
Ok I think I see where you are comming from, you dont understand how this works entirely, so I will explain it to you
theres the main modules which are directly chickynoid mods, Client and Server Inventory modules, These modules have a function called self:Setup(), this function will get called upon calling Chickynoid:Setup(), To make sure your mods get Setup you must register them first, refer to this example script for my game
local ServerStorage = game:GetService("ServerStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local Packages = ReplicatedFirst.Packages
local Chickynoid = require(Packages.Chickynoid).ChickynoidServer
local ServerMods = require(Packages.Chickynoid.Server.ServerMods)
Chickynoid:RecreateCollisions(workspace:FindFirstChild("GameArea"))
ServerMods:RegisterMod("servermods", ServerScriptService.Examples.ServerMods.UseNicerHumanoid)
ServerMods:RegisterMods("characters", ReplicatedFirst.Examples.Characters)
--ServerMods:RegisterMod("servermods", ServerScriptService.Examples.ServerMods.Health)
ServerMods:RegisterMod("servermods", ServerScriptService.Examples.MyMods.TMG)
ServerMods:RegisterMod("servermods", ServerScriptService.Examples.MyMods.ServerInventory)
ServerMods:RegisterMod("servermods", ServerScriptService.Examples.MyMods.ServerCommands)
Chickynoid:Setup()
In the Setup function you put whatever code you want to run, in order for your mod to work properly, also you can assign mods a priority to choose which run first and so on.
Inside the mod there is a CTool module, this means theres an object class created, this module contains a setup function too which is called by the Setup function of the Inventory mod
Theres a constructor function for creating your CTools, then you can also hook up code to the events of a CTool.
If you wanna create a class use the sword class as a base and make sure to hook up any code for your class into the Equipped event so it makes your Ctool do something upon being equipped
Keep in mind theres both a client and server sided version of the module
Theres also more to cover such as processing commands, handling events and blah blah blah.
I am not going to make a function for this since there’s thousands of different ways of attaching a model into a player’s hand.
However ill tell you a pretty good way of doing this yourself
You can use a motor6D to attach a model’s primary part into an arm, using an attachment to define the Motor6D’s position.
-- Welder script
local Rig = workspace.DevStuff.idk
local RightArm = Rig["Right Arm"]
local RightHandGrip = RightArm.RightHandAttachment
local Sledgehammer = Rig.Sledgehammer
local SledgehammerHandle = Sledgehammer.PrimaryPart
local Motor6D = Instance.new("Motor6D")
Motor6D.Parent = RightArm
print(RightHandGrip.CFrame)
print(Motor6D.C0)
Motor6D.C0 = RightHandGrip.CFrame
Motor6D.Part0 = RightArm
Motor6D.Part1 = SledgehammerHandle
Best part is that not only does it stays on the position of the hand, you can also animate it since its a Motor6D and not a weld!
Also make sure to do this on the client as characters are only seen on player’s clients and they do not exist on the server so you will manually have to replicate the effects.
Hey guys I have not released more features since I wanted to do a sword tool to include it with the resource so developers can see what this mod can do, but I couldn’t get it to work since recently I discovered that chickynoid cannot play 2 animations at once, so I worked all week with the help of @PixBlook I was able to make this cool fork that solves all of these issues:
Chickynoid “CharacterModel” fork for playing multiple animations at once! - Resources / Community Resources - DevForum | Roblox
Hey guys, Have not released an update for this resource in a while but after having a little talk with an user, I will work on writing some basic documentation for this resource so people can understand how it works quickly.
Also heres a cool game ive been working on that actually was the reason I even wrote this resource:
Untitled Network Test [Networking update soon!] - Roblox
Update V.1.2.1
Please update to V 1.2.2 if you are using chickytools right now as this bug makes the resource unusable after someone dies for the 11th time.
Apparently I was told that this resource was a mistake and that I should not work on it any further, I will change the direction of this resource to no longer be it’s own inventory system and instead a wrapper that imitates the behavior of roblox tools using chickynoid’s weapon module system.