What ive been trying to script for almost 2 days now, Is a Local Script in StarterPlayerScripts is this: A player has 15 seconds to enter a Area (Go inside a part) and when the 15 sec timer hits 0, The player’s camera or screen teleports to a specific part that im using as a camera.
The timer works and its not related to this script but when the timer hits 0 and im in the area nothing happens and it doesnt teleport me.
/ PLEASE IF ANYONE HAS TIME THEN PLEASE LET ME KNOW AND ILL INVITE YOU TO MY GAME IN STUDIO AND PLEASE HELP ME TAKE A LOOK FOR JUST 5 MINUTES MAX, I would be extremely grateful and its a lot for me because if i dont solve this detail then i can’t continue with my game wich is really important
local camera = workspace.CurrentCamera -- Player's active camera
local cameraPart = workspace.Cameras:WaitForChild("DalgonaTriangleCam") -- The part acting as the camera
local timerTextLabel = game.StarterGui.DalgonaGame.TimerExtra -- Timer UI
-- Listen for changes to the timer
timerTextLabel:GetPropertyChangedSignal("Text"):Connect(function()
if timerTextLabel.Text == "0" then
print("Timer hit 0! Switching to DalgonaTriangleCam.")
-- Switch the player's view to the part
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = cameraPart.CFrame
print("Camera teleported to DalgonaTriangleCam.")
-- Return to normal view after 10 seconds
task.delay(10, function()
camera.CameraType = Enum.CameraType.Custom
print("Returned to normal camera.")
end)
end
end)
PLEASE if anyone could spare 2-5 minutes taking a look at this your an angel thank you so much, im active a lot and might answer you directly, i have time from now and a few more hours
So none of the prints are in the output? That can mean that the
GetPropertyChangedSignal didn’t fire OR the first condition did not pass.
You can add a print before the condition and see if it outputs in the console. This would identify if the event is being fired or not.
local camera = workspace.CurrentCamera -- Player's active camera
local cameraPart = workspace.Cameras:WaitForChild("DalgonaTriangleCam") -- The part acting as the camera
local timerTextLabel = game.StarterGui.DalgonaGame.TimerExtra -- Timer UI
-- Listen for changes to the timer
timerTextLabel:GetPropertyChangedSignal("Text"):Connect(function()
print("Event fired")
if timerTextLabel.Text == "0" then
print("Timer hit 0! Switching to DalgonaTriangleCam.")
-- Switch the player's view to the part
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = cameraPart.CFrame
print("Camera teleported to DalgonaTriangleCam.")
-- Return to normal view after 10 seconds
task.delay(10, function()
camera.CameraType = Enum.CameraType.Custom
print("Returned to normal camera.")
end)
end
end)
Hard to test this, not everything is here to work with. However I do see a logic error that may be the main problem. You’re calling StarterGui and that is just a spot where them scripts get cloned to the players actual Gui folder in PlayerGui.
A quick guess …
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local cameraPart = workspace.Cameras:WaitForChild("DalgonaTriangleCam")
local timerTextLabel = player:WaitForChild("PlayerGui"):WaitForChild("DalgonaGame").TimerExtra
timerTextLabel:GetPropertyChangedSignal("Text"):Connect(function()
if timerTextLabel.Text == "0" then
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = cameraPart.CFrame
task.delay(10, function()
camera.CameraType = Enum.CameraType.Custom
end)
end
end)
I didn’t seem to notice that, and that may actually be the problem. There are no UI changes and updates inside the StarterGui, as it is just a container. The real UI changes are done in the Player’s PlayerGui, which is inside the Player object.