I want to make my script work correctly, which is getting bugged by character value.
My issue is that clientsided script loosing character value given from sever which breaks whole script.
I Tried to look for problems like mine on dev forum, but after some small searchs didnt find anything what will help me in fixing the problem, i tried storing value in different ways, but it also didnt help me.
So, this is my script of loading all information and models in character for gameplay:
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:connect(function(Character)
-- // Functions Data
local Model = Models.Standless
local Sounds = Sounds:WaitForChild("Standless"):Clone():GetChildren()
local RightTrail = Model["Right Arm"]:Clone():GetChildren()
local LeftTrail = Model["Left Arm"]:Clone():GetChildren()
local Data = {
Ability = "Standless",
guy = Character
}
print("This is from server:")
print(Data["guy"])
print(Data["Ability"])
--// Models Inserting
for i, Children in pairs(RightTrail) do
Children.Parent = Character["Right Arm"]
end
for i, Children in pairs(LeftTrail) do
Children.Parent = Character["Left Arm"]
end
for i, Children in pairs(Sounds) do
Children.Parent = Character.HumanoidRootPart
end
-- // Remotes
Remotes.Gameplay.ClientSide:FireAllClients("Global", "LoadAnimations", Data)
Character.HumanoidRootPart:SetAttribute("CountOfClicks", 1)
end)
end)
but problem starts only on this part of this script:
Remotes.Gameplay.ClientSide:FireAllClients("Global", "LoadAnimations", Data)
as you can see i am porting characters and abilities value to the clientsided script from the server, and after i saw error in it and decided to print values on server script, client script which runs module and module itself.
Client script which runs module if needed:
Remotes.Gameplay.ClientSide.OnClientEvent:Connect(function(Module, ModuleFunction, Data)
local Character = Data["guy"]
local Ability = Data["Ability"]
print("This is from clientsided script between:")
print(Character)
print(Ability)
ModulesStorage[tostring(Module)][ModuleFunction](Data)
end)
and get this as result:

And as we can see characters value getting lost on clientsided script, and i dont know why. Ill be really glad if someone will help me with this issue