Im trying to figure it out but, any help is appreicated.
local SettingsEvent = game.ReplicatedStorage.SettingsEvent
SettingsEvent.OnServerEvent:Connect(function(player, SettingType, boolean)
if SettingType == "Korblox" then
local Humanoid = player.Character:FindFirstChild("Humanoid")
if boolean then
local descriptionClone = Humanoid:GetAppliedDescription()
descriptionClone.RightLeg = 139607718
Humanoid:ApplyDescription(descriptionClone)
else
--Trying to figure it out
end
end
end)
Have an array with each value being the player’s old leg that gets set before changing the leg
Make sure the old leg isn’t the korblox leg id though.
local PlayerLegs = {
}
SettingsEvent.OnServerEvent:Connect(function(player, SettingType, boolean)
if SettingType == "Korblox" then
local Humanoid = player.Character:FindFirstChild("Humanoid")
if boolean then
local descriptionClone = Humanoid:GetAppliedDescription()
PlayerLegs[Player] = descriptionClone.RightLeg -- Save old leg (add check to make sure its not a korblox leg)
descriptionClone.RightLeg = 139607718
Humanoid:ApplyDescription(descriptionClone)
else
if PlayerLegs[Player] then
-- Apply old leg to character
end
end
end
end)
local SettingsEvent = game.ReplicatedStorage.SettingsEvent
local PlayerLegs = {
}
SettingsEvent.OnServerEvent:Connect(function(player, SettingType, boolean)
if SettingType == "Korblox" then
local Humanoid = player.Character:FindFirstChild("Humanoid")
if boolean then
local descriptionClone = Humanoid:GetAppliedDescription()
PlayerLegs[player] = descriptionClone.RightLeg
descriptionClone.RightLeg = 139607718
Humanoid:ApplyDescription(descriptionClone)
else
if PlayerLegs[player] then
local descriptionClone = Humanoid:GetAppliedDescription()
descriptionClone.RightLeg = PlayerLegs[player.UserId]
Humanoid:ApplyDescription(PlayerLegs[player])
end
end
end
end)
This is because youre using the userid to index the playerlegs array instead of the actual player object. In Humanoid:ApplyDescription if the boolean is false you have to pass in the description and not the leg id.
I don’t like to spoonfeed since you don’t learn anything from it, you just have to set the descriptionClone’s right leg in the else block to use the player object instead of userid and Humanoid:ApplyDescription to use the description clone.