The CheckOthersActive
Skill | WCS property deals with this exact functionality. Set it to false
in the skills you would like to use even if another is active.
i think there’s something wrong, when i use self.Player it prints nil and causes a error, and i need to use self.Character.Player for it to work and also retrieve the character model
where are you using self.Player
?
In OnConstructServer Enclosed function, when the skill inits, i do something like this
local Player = self.Player
local charactermodel = Player.Character
well, that’s how i used to do it a few updates ago, before it stopped working, if you could check if it’s A wcs problem would be great
Also i noticed when i do print(self), The character table has the player, it shouldn’t be the player table outside of the character table?
Is there a way to check if a skill is on cooldown? I’ve tried looking through the cooldown timer but I couldn’t really make sense of anything, and I couldn’t find any built in methods for this in the api.
Yeah I’m dumb, completely forgot about that lol
Framework looks very nice, has it been battle tested in huge player environments? Curious about the performance, the structure is fine.
It would be nice if OnConstruct is called before OnConstructServer or OnConstructClient since I would want values or variables to exist on both the client and server such as the current Characters HumanoidRootPart or something else. With the current behavior, I cant use variables from the OnConstruct method.
For skills*
OnConstruct
, OnConstructServer
and OnConstructClient
are going to be deprecated in typescript due to the constructor execution order, prefer settings values in constructor.
What does this mean? How would I prevent having to write the same code in OnConstructServer and OnConstructClient?
the path to the module is incorrect or doesnt exist.
it does though
i will send you an example file of how to set this up, it should work.
Not sure what is going on with your side, maybe misplaced the client and server handlers.
Wait 10 minutes and i will dm you the rbxm
Currently, I’m having a issue that i feel is so simple yet i cant fix it
So, I’m trying to switch between 3 Move Sets i created using topbarv3
here is the code
Topbar:
local container = script.Parent
local Icon = require(container.Icon)
–Services
local LightingService = game:GetService(“Lighting”)
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local DataStoreService = game:GetService(“DataStoreService”)
local StarterGui = game:GetService(“StarterGui”)
local Players = game.Players
local Remotes = ReplicatedStorage.Communication.Remotes
local SetUpRemotes = Remotes.SetUp
local MovesetRemotes = Remotes.MovesetRemotes
local Values = ReplicatedStorage.Communication.Values
local Agreed = Values.Agreed
local ControlsGui = Players.LocalPlayer.PlayerGui.Core.Controls
–Characters
Icon.new()
:setLabel(“”)
:autoDeselect(true)
:setImage(15728996305, “Deselected”)
:setImage(15728996305, “Selected”)
:setCaption(“Characters”)
:setDropdown({
Icon.new()
:autoDeselect(true)
:setLabel(“Hero”)
:setImage(17262129975)
:bindEvent(“selected”,function()
SetUpRemotes.Hero:FireServer()
MovesetRemotes.Hero:FireServer()
end),
Icon.new()
:autoDeselect(true)
:setLabel(“Slayer”)
:setImage(17262129975)
:bindEvent(“selected”,function()
SetUpRemotes.Slayer:FireServer()
MovesetRemotes.Slayer:FireServer()
end),
Icon.new()
:autoDeselect(true)
:setLabel(“Brute”)
:setImage(17262129975)
:bindEvent(“selected”,function()
SetUpRemotes.Brute:FireServer()
MovesetRemotes.Brute:FireServer()
end)
})
Then the ServerHandler where the remote events are recieved and moveset is changed
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local Players = game:GetService(“Players”)
local WCS = require(ReplicatedStorage.Modules.wcs)
local Hero = require(ReplicatedStorage.Movesets.Hero)
local Slayer = require(ReplicatedStorage.Movesets.Hero)
local Brute = require(ReplicatedStorage.Movesets.Hero)
local Character = WCS.Character
local Server = WCS.CreateServer()
local Remotes = ReplicatedStorage.Communication.Remotes
local MovesetRemotes = Remotes.MovesetRemotes
Server:RegisterDirectory(ReplicatedStorage.Movesets)
Server:Start()
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(CharacterModel)
– apply the wrap when character model gets created
local WCS_Character = Character.new(CharacterModel)
-- apply our moveset to the character
WCS_Character:ApplyMoveset(Hero)
-- destroy it when humanoid dies
local Humanoid = CharacterModel:WaitForChild("Humanoid")
Humanoid.Died:Once(function()
WCS_Character:Destroy()
end)
end)
end)
MovesetRemotes.Hero.OnServerEvent:Connect(function(player,CharacterModel)
local WCS_Character = Character.new(CharacterModel)
WCS_Character:ClearMoveset()
WCS_Character:ApplyMoveset(Hero)
local Humanoid = CharacterModel:WaitForChild("Humanoid")
Humanoid.Died:Once(function()
WCS_Character:Destroy()
end)
end)
MovesetRemotes.Slayer.OnServerEvent:Connect(function(player,CharacterModel)
local WCS_Character = Character.new(CharacterModel)
WCS_Character:ClearMoveset()
WCS_Character:ApplyMoveset(Slayer)
local Humanoid = CharacterModel:WaitForChild("Humanoid")
Humanoid.Died:Once(function()
WCS_Character:Destroy()
end)
end)
MovesetRemotes.Brute.OnServerEvent:Connect(function(player,CharacterModel)
local WCS_Character = Character.new(CharacterModel)
WCS_Character:ClearMoveset()
WCS_Character:ApplyMoveset(Brute)
local Humanoid = CharacterModel:WaitForChild("Humanoid")
Humanoid.Died:Once(function()
WCS_Character:Destroy()
end)
end)
Code is very messed up i will just link a rbxm
ServerHandler.rbxm (1.3 KB)
CurrentTopbar.rbxm (67.0 KB)
You forgot to require
the module.