This problem is a literal nightmare for me now
I CANT FIX IT NO MATTER WHAT I DO!!
The Local Script thinks the player is still falling, BUT HES NOT!
repeat wait() until game:IsLoaded() == true
local RespawnSystem = workspace:FindFirstChild('RespawnSystem')
local RefreshEvent = RespawnSystem:FindFirstChild('RefreshPlayer')
local Camera = workspace.CurrentCamera
local CriticalHeightBlock = RespawnSystem:FindFirstChild('CriticalHeight')
local RespawnignOnServer = RespawnSystem:FindFirstChild('RespawningEnabledServer')
local RunService = game:GetService('RunService')
local TweenService = game:GetService('TweenService')
local Players = game:GetService('Players')
local Player = Players.LocalPlayer
local Character = Player.Character
local PrimaryPart:BasePart = Character:FindFirstChild('HumanoidRootPart')
local FallDebounce = false
local CameraLooking = false
Player.CharacterAdded:Connect(function(char)
wait(2
)
FallDebounce = false
end)
task.spawn(function()
while wait(0.1) do
local RaycastParamsCharacter = RaycastParams.new()
RaycastParamsCharacter.FilterType = Enum.RaycastFilterType.Exclude
RaycastParamsCharacter.FilterDescendantsInstances = {Character}
local RaycastingResult = workspace:Raycast(PrimaryPart.Position, Vector3.new(0,-900,0), RaycastParamsCharacter)
if not RaycastingResult then
if PrimaryPart.Position.Y <= CriticalHeightBlock.Position.Y and FallDebounce == false then
if FallDebounce == false then
FallDebounce = true
script.Parent.Scream:Play()
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until
Camera.CameraType == Enum.CameraType.Scriptable
CameraLooking = true
task.spawn(function()
while wait() do
if CameraLooking == true then
TweenService:Create(Camera, TweenInfo.new(0.07, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0), {CFrame = CFrame.lookAt(Camera.CFrame.p, PrimaryPart.Position)}):Play()
end
end
end)
wait(2)
CameraLooking = false
RefreshEvent:FireServer()
Camera.CameraType = Enum.CameraType.Custom
PrimaryPart.Position = PrimaryPart.Position
task.spawn(function()
wait(20)
--FallDebounce = false
end)
end
end
end
end
end)
When the player is falling down, its supposed to respawn him. It does the job, but once he respawns. THE GAME STILL THINKS HES THERE ![]()
I dont know what to do at this point.
Any help would be appreciated