Error with dialog conditions with Dialogue Maker [Beta] By Beastslash

I want to know why my condition is breaking the plugin, Dialogue Maker [Beta] By Beastslash. By breaking, what I mean is that the following error appears.

"PlayerScripts.DialogueClientScript.API.Dialogue:441: attempt to index nil with 'Redirect’ "

The error causes the screenGUI to popup which is expected and proper, but the text fails to load.

The error then stays even after pressing the “fix scripts” / deleting the script. I also tried reverting the conditions to what they were before I typed in mine, also deleting the condition module scripts but the error still lingers.

The condition im talking about is the following:

return function(player)
	local lightingService = game:GetService("Lighting")
	local clockTime = lightingService.ClockTime
	
	if clockTime >= 6 and clockTime < 12 then
		-- Return true if the condition is met
		return true
	else
		-- Return false if the condition is not met
		return false
	end
end;

I barely know lua so i might be doing something wrong with the condition script that causes it to break, so i really need assistance. Thanks in advance!

Just to make things clear, I’m trying to add conditions that check if its morning/noon/afternoon/night/midnight in my game that have day-night cycle so that the npc will use the appropriate greetings.

I figured it out, there’s an error in my condition.

return function(player)
local Time = game:GetService(“Lighting”).ClockTime
if Time>=23.5 or Time<0.5 then
return true
end

end;

instead of “or” i used “and” previously, causing the error

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.