I want my game to only be in r6 but the avatars settings don’t save. I don’t know if I am doing something wrong or it’s a bug. Please help me. The save changes button doesn’t work either.
Ill make you a script that will force game to use an R6 Rig since avatar settings do not work for ya, gimme some minutes/so!
It might be cause you are in a team create, so the game file doesnt actually get to restart when you press save and restart.
Thats just my guess though
This should work, if r15 it will automatically convert the character to R6
ServerScriptService or so
--!native
--// Services
local Players = game:GetService("Players")
-- Formatting stuff is good practice!
--// Functions
-- Storing as a function since it will be used twice.
local function OnCharacterAdded(character:any,player:any,UserId:number)
if character:GetAttribute("R6") then return character:SetAttribute("R6",nil) end --// This is OK
--// Check if we are R15
local UpperTorso = nil
pcall(function()UpperTorso=character.UpperTorso end)
--// Pcall is much faster than FindFirstChild, ive done a benchmark myself and same for another user
if UpperTorso then
local Pivot, CharName = character:GetPivot(), character.Name
character:Destroy()
--// Cache results so we dont abuse the API
local Description = nil
pcall(function()Description=player.R6 end)
if not Description then
local s, t = nil, 3
repeat
s, Description=pcall(function()
return Players:GetHumanoidDescriptionFromUserId(UserId)
end)
if not s then t-=1 task.wait(1) end
until s or t==0
Description.Name="R6"
Description.Parent=player
end
--// Create a new rig with the description, once created, cache it!
local Rig = nil
pcall(function()Rig=player.R6RIG end)
if not Rig then
local s, t = nil, 3
repeat
s,character=pcall(function()
return Players:CreateHumanoidModelFromDescription(Description,Enum.HumanoidRigType.R6)
end)
if not s then t-=1 task.wait(1) end
until s or t==0
if not s then
return player:Kick("Something terrible happened which should never be the case, you can change what happens if you want.")
else
character.Parent=player
character.Name="R6RIG"
character=character:Clone()
end
else
character=Rig:Clone()
end
character:SetAttribute("R6",true) --// Since we add a new character itll call CharacterAdded again
character.Name=CharName
--character.ModelStreamingMode=Enum.ModelStreamingMode.Persistent -- i would use this if a spectate player script or so exists
character:PivotTo(Pivot)
player.Character=character
character.Parent=workspace
UpperTorso=nil
end
end
local function OnPlayerAdded(player:Player)
local UserId = player.UserId
player.CharacterAdded:Connect(function(character)
OnCharacterAdded(character,player,UserId)
end)
if player.Character then
OnCharacterAdded(player.Character,player,UserId)
end
end
--// Where it converts to R6 if R15
Players.PlayerAdded:Connect(OnPlayerAdded)
--// Incase if player loads before our connection
for _,v in pairs(Players:GetPlayers()) do task.spawn(OnPlayerAdded,v) end
1 Like
Where do I disable it? the button disappeared.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.