So I am trying to make a script that changes the player’s size (in R6 only) from 1x size to 2x back to 1x size, I don’t know much about Motor6D and how the attachments work but this is the script to make the player’s size 2x. Is there any way to reverse the effects of making an R6 player 2x size?
local Width = 1.5
local Height = 1.5
local Depth = 1.5
local Vector = Vector3.new(Width, Height, Depth)
for i,Motor in pairs(Player.Character.Torso:GetChildren()) do
if Motor:IsA("Motor6D") == false then continue end
table.insert(Motors, Motor)
end
for i,v in pairs(Motors) do
v.C0 = CFrame.new((v.C0.Position * Vector)) * (v.C0 - v.C0.Position)
v.C1 = CFrame.new((v.C1.Position * Vector)) * (v.C1 - v.C1.Position)
end
for i,Part in pairs(Player.Character:GetChildren()) do
if Part:IsA("BasePart") == false then continue end
Part.Size *= Vector
end
if Player.Character.Head.Mesh.MeshId ~= "" then
Player.Character.Head.Mesh.Scale *= Vector
end
for i,Accessory in pairs(Player.Character:GetChildren()) do
if Accessory:IsA("Accessory") == false then continue end
Accessory.Handle.AccessoryWeld.C0 = CFrame.new((Accessory.Handle.AccessoryWeld.C0.Position * Vector)) * (Accessory.Handle.AccessoryWeld.C0 - Accessory.Handle.AccessoryWeld.C0.Position)
Accessory.Handle.AccessoryWeld.C1 = CFrame.new((Accessory.Handle.AccessoryWeld.C1.Position * Vector)) * (Accessory.Handle.AccessoryWeld.C1 - Accessory.Handle.AccessoryWeld.C1.Position)
Accessory.Handle:FindFirstChildOfClass("SpecialMesh").Scale *= Vector
end
My question is how would I make a player BACK to 1x normal size AFTER making the player 2x size, I tried making 2 functions one which made the player 2x which worked, and another function that made the player 1x and if I ran the 1x function after the 2x it would not revert the player. Also, I can’t reset or kill the player in my game.
Did you read my 2nd script suggestion on how to make them 1/2 size?
Put a variable in your script (for example: size) and make it true when the script starts and the player is normal size.
Then in one function for changing size check:
if size = true then
--stuff to make player large (* 2)
size = false
else
--stuff to make player small (*.5)
size = true
end
When I make the player 1.5x size then make it 0.5x size to try to attempt to make the player back to normal size the attachments are still messed up and this is the part I don’t know how to fix.
I found a solution, I was using the Motors = {} table globally and not locally for each function, and that caused it to go wonky, Thanks for trying to help though