When teleported, model is turned 90 degrees

Code:

local function SetUpRarity()
	
	ChosenRarity, RarityChance = ChooseRarity()

	ChosenReward = RarityRewards[ChosenRarity][math.random(1,#RarityRewards[ChosenRarity])] -- RarityRewards[ChooseRarity()] indexs the tables of rewards for the rarity. [math.random(1,#RarityRewards[ChooseRarity()])] chooses a random reward from the table

	ClaimPad.Color = RarityColors[ChosenRarity]

	InfoLabel.Text = ChosenRarity .. " (" .. RarityChance .. "%) - " .. abbreviateNum(ChosenReward)

	local AppropriateGradient = game:GetService("ReplicatedStorage"):WaitForChild("Gradients"):FindFirstChild(ChosenRarity):Clone()
	AppropriateGradient.Parent = InfoLabel
	
	local ChosenPos = Vector3.new(math.random(-252,252),0.125,math.random(-252,252))
	
	script.Parent:PivotTo(CFrame.new(ChosenPos))
	
end

When the model is teleported in a random location it is turned 90 degrees

2 Likes

You arent keeping the Original Rotation of the Old CFrame When using :PivotTo(), CFrames are both Position and Rotation.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.