if script.Parent.Text == "5" then game.ReplicatedStorage.NextLevelEvent:FireServer() print("server fired") end
Try this
local debounce = false while wait() do if deboune == false then debounce = true if script.Parent.Text == "5" then game.ReplicatedStorage.NextLevelEvent:FireServer() print("server fired") wait(3) -- The amount of time until it fires again debounce = false end end end
I'm sure this should work, what it does is whenever the text is changed, it will check if the text is "5" and if it's 5 then it will fire the event.
script.Parent:GetPropertyChangedSignal("Text"):Connect(function() -- when text is changed if script.Parent.Text == "5" then game.ReplicatedStorage.NextLevelEvent:FireServer() print("server fired") end end)