#How can i make this work
1 messages · Page 1 of 1 (latest)
We need a bit more information
What exactly doesn't work
Is it not getting the correct move?
local moveModule = require(EcharModule.Moves:WaitForChild(movekey))
And what exactly is within your move module
but yeh more info
He can technically do .WaitForChild but he needs to put the self instance in the front
move module just has a print so i can test it
on the function
change .WaitForChild to :WaitForChild
Shwo the code within the Move Module
since ur not passing self
Do that as well
oh yeah thanks i did not see that
this is inside One
Does the client pass the correct information?
whats the getEcharModule fucntion
it gets the module of your current equiped character
** You are now Level 1! **
Print movekey to see it's correct
can u sedn the code for it
sure
On the server, there should be no need to use :WaitForChild() unless you know something will not exist for a period of time
Use :FindFirstChild to check if that object exists or not
SkillEvent.OnServerEvent:Connect(function(player, movekey)
local EChar = CharModule.GetEChar(player)
local ECharModule = CharModule.GetECharModule(player)
local MoveModule = ECharModule.Moves:FindFirstChild(moveKey)
if not MoveModule then return end
require(MoveModule).Move(Player)
end)
Do checks like this
:FindFirstChild will either return the object you are looking for or nil if it doesn't exist
So we check if it exists, if not then we don't do anything
Afterwords, we just require the module and get the function
ECharModule.Moves does not exist
Which means your ECharModule doesn't return something correctly
print ECharModule
yeah but i want to get to the folder
Then make the module return the folders
how could i do that?
** You are now Level 2! **
if you need the module it's up on the chat
did you make these scripts?
yes
idrk how your code works that well or where your modules are stored but I would presume you can easily just get the folders from this and return that rather than the CharModule
ok ill try making this change
whats movekey