heya
i wanted to create a text block that appears when a certain character dies,, though ive put it in kinda weirdly..
i want the heartbeat runservice to disconnect when the enemy is killed,, but i keep getting the same "Disconnect is not a valid member of RBXScriptSignal" error when the character does die
print("YES I DO ANYTYING AT ALL HI")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local open = false
local heartbeathaha = RunService.Heartbeat
heartbeathaha:Connect(function()
if workspace.megabob.Humanoid.Health == 0 then
heartbeathaha:Disconnect(function()
print("MEGABOB DEAD YES HI")
local StarterGui = Players:WaitForChild("PlayerGui")
local ScreenGui = StarterGui.bobquestion1
local Frame = ScreenGui.Frame
Frame.Visible = true
if open == false then
open = true
Frame.Visible = true
wait(4)
Frame.Visible = false
ScreenGui = StarterGui.bobquestion2
Frame = ScreenGui.Frame
Frame.Visible = true
open = true
Frame.Visible = true
wait(4)
Frame.Visible = false
heartbeathaha:Disconnect()
end
end)
else
print("THIS CODE WORKS CORRECTLY")
open = false
local StarterGui = Players:WaitForChild("PlayerGui")
local ScreenGui = StarterGui.bobquestion1
local Frame = ScreenGui.Frame
Frame.Visible = false
print("THIS CODE WORKS VERY CORRECTLY")
end
end
)
can someone tell me what exactly is going wrong here..? im not the greatest at troubleshooting
