I’m trying to make it so that it does not flip sideways, since I want to to lie flat on the ground. However, when I’m scripting it, and configure the CFrame with the script, it somehow flips sideways when playtesting it… I’m pretty novice in coding, but i’ve tried to like set different cframes and play around with it.
This is the current script that I have, it semi-works; it puts it in the right position when its needs to be, but is flipped sideways.
-- Variables
local ButtonPart = script.Parent
local BasePart = game.Workspace.TycoonOne.SectionOne.LightingBasePart
local basePartPosition00 = CFrame.new(-35.12, -21.635, -100.865)
local ButtonPartPosition00 = CFrame.new(-35.12, -21.595, -100.865)
local basePartPosition01 = CFrame.new(-35.12, 2.075, -100.865)
local ButtonPartPosition01 = CFrame.new(-35.12, 2.085, -100.865)
local StartDiggingOwned = game.ReplicatedStorage.StartDiggingSectionOneOwned
local LightingOwned = game.ReplicatedStorage.LightingSectionOneOwned
--CFrame positioning loop
while wait() do
if StartDiggingOwned.Value == 1 and LightingOwned.Value == 0 then
-- Previous item owned but current item not owned
ButtonPart.CFrame = ButtonPartPosition01
BasePart.CFrame = basePartPosition01
elseif StartDiggingOwned.Value == 0 and LightingOwned.Value == 0 the
-- None of the needed items owned
ButtonPart.CFrame = ButtonPartPosition00
BasePart.CFrame = basePartPosition00
end
end
Thanks,
BurgerLord
