I need help with a Jumpscare script for a game,
when the animatronic is at the door and it is open, it sets the dead value to true. Workspace: StarterGui: Deathscript:
When the animatronic does what it’s supposed to do it does not work.
Please if someone could help me I’d appreciate it.
It only prints to BeforeIfStatement so the error should be there.
There is another issue, this if statement only runs once and will only check the Dead value a single time. In order to change this you have to constantly check if the value is being changed or has changed.
There are two solutions, you can use
while true do
-- condition statement
wait()
end
Which will constantly run that if statement…
Or you can fire a function that happens only when the value of dead changes using GetPropertyChangedSignal:
game.Players.LocalPlayer:WaitForChild("PlayerGui").ScreenGui.Frame:GetPropertyChangedSignal('Value'):Connect(function()
-- do you frame visible stuff here which will fire when value changes
end
So there is that thing that decals that you load on the Roblox Website have a different Id from the onces that you actually put into a ImageLabel or Decal. Try actually putting your “Frames” into an image label before using their final Id.
Also if your dead value is set true from the client the server wouldn’t accept it, because it doesn’t know whenever a client changes a certain value. Use fire server in that case.
should be in a loop, its not printing the other prints as it only checks if the player is dead at the start of the game, because any script thats not in a loop or not broadcasted is powered at the start of the game.