Okay so, the actual scripts seem to work. I can see that they trigger what needs to be triggered in the properties menu, but it does not occur in game.
First problem:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
wait(1)
game.Workspace.Values.Warning.Value = true
end
end)
This code is designed to activate a bool value when the player walks through an invisible part that sets off a series of events necessary to the experience. It actually works; the “warning” value is set to true in properties, but it does not function in game unless “warning” is set to true before playtesting the game.
What’s the deal? Why won’t the events attached to the value occur when the value is activated by the player collision?
Second problem (script shortened to highlight the area of issue):
local tv = script.Parent
local eas = tv.EAS
local ssss = tv.Static
local screen = tv.SurfaceGui
local warning = game.Workspace.Values.Warning
local outage = game.Workspace.Values.Outage
local val = game.Workspace.Values
if outage.Value == true then
game.Workspace.ZAP:Play()
eas:Stop()
screen.Enabled = false
tv.Ssss.Enabled = false
tv.Decal1.Transparency = 1
tv.Decal2.Transparency = 1
tv.Decal3.Transparency = 1
val.LightBD = false
val.LightBR = false
val.LightKT = false
val.LightLR = false
screen.Enabled = false
wait(1)
game.Workspace.STORMSOUNDS.ThunderRumble:Play()
wait(3)
game.StarterGui.ScreenGui.TextBox.Visible = true
game.StarterGui.ScreenGui.TextBox.Text = "[Text]"
wait (5)
game.StarterGui.ScreenGui.TextBox.Visible = false
end
This string of functions simulates a blackout in the game. Only half of it works. Once the “outage” value is triggered, everything follows as it’s supposed to until after wait(1)
. The thunder doesn’t play and the text GUI doesn’t show. Why are these things just cut off like that? What needs to be changed so that the whole string works?
Thanks in advance for the help, everyone. This may or may not be a huge thing because I’m just an amateur, but I appreciate it greatly as help to get this project out.
Please ask questions if you need more context or understanding!