hey.
so i made a previous post about CFrame about 3 days ago, and I tried all of the solutions, and they worked perfect.
so i tried the solutions again, so that the player could exit out of the area he is in, and make it look like he is walking up the place he had came from.
unfortunately, thats not the case.
here is the video:
here is the code:
local plr = game:GetService('Players').LocalPlayer
local chr = plr.Character or plr.CharacterAdded:Wait()
local cam = require(plr.PlayerScripts.Player.PlayerCamera.Handler)
local cammain = plr.PlayerScripts.Player.PlayerCamera
local plrgui = plr.PlayerGui
local hud = plrgui:WaitForChild('UIHud')
local controls = require(plr.PlayerScripts.ControlScript.Handler)
local typewriter = require(game:GetService('ReplicatedStorage').Typewriting.Typewriter)
local ts = game:GetService('TweenService')
local musichandle = require(plr.PlayerScripts.Player.Music)
local hrp = chr:WaitForChild('HumanoidRootPart')
local hum = chr:WaitForChild('Humanoid')
local swordareas = {
SwordArea1 = 'SwordArea1',
SwordArea1Exit = 'ExitSwordArea1'
}
local function Wizard1Test ()
local OldManTest = workspace.OldMan1
local flame1 = OldManTest.Flame1
local flame2 = OldManTest.Flame2
flame1.RootAttachment.PE1:Emit(10)
flame2.RootAttachment.PE1:Emit(10)
OldManTest.OldMan.HumanoidRootPart.RootAttachment.PE1:Emit(15)
wait(0.3)
for i, v in pairs(flame1:GetChildren()) do
if v:IsA('ParticleEmitter') then
v.Enabled = true
end
end
for i, v in pairs(flame2:GetChildren()) do
if v:IsA('ParticleEmitter') then
v.Enabled = true
end
end
coroutine.resume(coroutine.create(function()
for i, v in pairs(OldManTest.OldMan:GetChildren()) do
local PrevV = 'HumanoidRootPart'
if (v:IsA("BasePart") or v:IsA("Decal")) and v.Name ~= "HumanoidRootPart" and v.Name ~= PrevV then
local partween = ts:Create(v, TweenInfo.new(0.5), {Transparency = 0})
partween:Play()
end
for i, o in pairs(v:GetChildren()) do
if o:IsA('Decal') then
local decaltween = ts:Create(o, TweenInfo.new(1), {Transparency = 0})
decaltween:Play()
end
end
end
end))
--[[
for i, o in pairs(v:GetChildren()) do
if o:IsA('Decal') then
local decaltween = ts:Create(v, TweenInfo.new(1), {Transparency = 0})
decaltween:Play()
end
end
]]
return
end
-- Sword Area 1 --
hum.Touched:Connect(function(obj)
local TEnable = workspace:WaitForChild('Files').UndergroundAreaPoints.SwordArea1.TPEnabled
local platedown = workspace:WaitForChild('Files').UndergroundAreaPoints.SwordArea1.PlateDown
if (obj:IsA('Part') and obj.Name == swordareas.SwordArea1) then
obj.Plate.CanCollide = false
plrgui.UIHud.HudInput.Disabled = true
if TEnable.Value ~= false then
TEnable.Value = false
hrp.CFrame = CFrame.new(hrp.Position)
hrp.Anchored = true
musichandle:StopMusic()
local downward = ts:Create(hrp, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {CFrame = hrp.CFrame * CFrame.new(0,-9,0)})
downward:Play()
plr.PlayerScripts.Player.Sounds.walkway:Play()
task.wait(0.8)
game.Lighting.BlackoutCorrection.Enabled = true
task.wait(0.8)
hrp.Anchored = false
task.wait()
controls:Disable()
game.Lighting.BlackoutCorrection.Enabled = false
game.Lighting.Atmosphere.Density = 0.525
hrp.CFrame = workspace:WaitForChild('Files').Points.FirstCavePoint.CFrame * CFrame.new(0,3,0)
cammain.Coordinates.CoordinatePosition.Value = CFrame.new(cammain.Coordinates.CoordinatePosition.Value.X, cammain.Coordinates.CoordinatePosition.Value.Y, 40)
wait()
cam:loadcam()
hud.Line.Text = ''
hud.Line.Visible = true
Wizard1Test()
-- [[]] TESTING DIALOGUE AND WEAPON POSSESSION -- [[]]
typewriter:Typewrite(hud.Line, 'ITS DANGEROUS TO GO ALONE! TAKE THIS.')
task.wait(1)
controls:Enable()
plrgui.UIHud.HudInput.Enabled = true
end
end
if (obj:IsA('Part') and obj.Name == swordareas.SwordArea1Exit) then
if TEnable.Value ~= true then
hrp.CFrame = CFrame.new(hrp.CFrame.Position) * CFrame.Angles(0, -3.15, 0)
coroutine.resume(coroutine.create(function()
hrp.Anchored = true
controls:Disable()
hrp.CFrame = platedown.CFrame
local upward = ts:Create(hrp, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = hrp.CFrame * CFrame.new(0,8,0)})
local forward = ts:Create(hrp, TweenInfo.new(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = hrp.CFrame * CFrame.new(0,0,-4)})
hud.Line.Text = ''
hud.Line.Visible = false
game.Lighting.Atmosphere.Density = 0
plrgui.UIHud.HudInput.Enabled = false
cam:manualoadcam(0.6, 3, -9.6)
cammain.Coordinates.CoordinatePosition.Value = CFrame.new(cammain.Coordinates.CoordinatePosition.Value.X, cammain.Coordinates.CoordinatePosition.Value.Y, 48)
task.wait(0.8)
plr.PlayerScripts.Player.Sounds.walkway:Play()
upward:Play()
upward.Completed:Wait()
forward:Play()
end))
end
end
end)
--[[
TEnable.Value = true
hrp.Anchored = false
controls:Enable()
hrp.Anchored = true
controls:Disable()
game.Lighting.BlackoutCorrection.Enabled = true
hrp.CFrame = CFrame.new(hrp.CFrame.Position) * CFrame.Angles(0, -3.15, 0)
hrp.CFrame = platedown.CFrame
hud.Line.Text = ''
hud.Line.Visible = false
game.Lighting.Atmosphere.Density = 0
plrgui.UIHud.HudInput.Enabled = false
cam:manualoadcam(0.6, 3, -9.6)
cammain.Coordinates.CoordinatePosition.Value = CFrame.new(cammain.Coordinates.CoordinatePosition.Value.X, cammain.Coordinates.CoordinatePosition.Value.Y, 48)
task.wait(0.8)
game.Lighting.BlackoutCorrection.Enabled = false
plr.PlayerScripts.Player.Sounds.walkway:Play()
local upward = ts:Create(hrp, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = hrp.CFrame * CFrame.new(0,8,0)})
local forward = ts:Create(hrp, TweenInfo.new(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = hrp.CFrame * CFrame.new(0,0,-4)})
upward:Play()
upward.Completed:Wait()
forward:Play()
forward.Completed:Wait()
]]
please help? thank you. it might be something small im not noticing. i dont know.