I'm making a script where you can freeze other players. The players have morphs as well, which are stored inside of the player's character. This means that :GetExtentsSize() gets the correct size of the entire player model, but it doesn't return the offset used to make it. According to the wiki, it uses an offset based on a primary part (in this case, the player's head). How can I get it to position the block of ice correctly?
local iceblock = Instance.new("Part")
iceblock.Anchored = true
iceblock.Transparency = 0.5
iceblock.BrickColor = BrickColor.new("Teal")
--This fires when the player is hit and becomes frozen:
plr.Character.Torso.Anchored = true
local newice = iceblock:clone()
newice.Size = plr.Character:GetExtentsSize()
newice.CFrame = plr.Character:GetPrimaryPartCFrame()
newice.Parent = game.Workspace
repeat
wait(5)
until math.random(1,5) == 1
newice:Destroy()
plr.Character.Torso.Anchored = false

1 comment
Note that I only gave excerpts from the main script, because that's where the problem lies.