ModuleScript gives incomplete statement error only in game

I get an incomplete statement error on the first line of this module script, even though there does not seem to be any error. This script worked before, and i haven’t changed anything but it randomly started doing it. It only happens in the published instance of the game, but not in any studio tests.

local module = {}

module.Name = 'Sir Bear'

module.Animations = {
	[1]= {'Idle',13906335755,true}
}

module.Dialog = {
	Start = {
		[1] = {Text = 'Hello yong chap! ',

			Responses = {
				[1] = {Text = 'Uhh... Hello?',Next = 2},
				[2] = {Text = 'You.. Your a bear?', Next = 2}
			}
		},
		[2] = {
			Text = 'Yes, I know its quite weird for a bear to be here! Its just temporary, until those bloody annoying humans get out of my cave!',

			Responses = {
				[1] = {Text = 'Your cave?', Next = 3}
			}
		},
		[3] = {
			Text = 'Yes! Nice flat on that there mountain! Unfortunately some miners intruded in my house! Quite rude innit!',

			Responses = {
				[2] = {Text = 'That sucks, good luck with that',Next = 5},
				[1] = {Text  = "I'll take care of them. Don't worry, Sir Bear", Next = 4, Effect = function()  game.ReplicatedStorage.RemoteEvents.Activites.Quests.AddQuest:FireServer('ClearSirBearsHouse') end}
			}
		},
		[4]  = {
			Text = 'Jolly GOOD! Thank you, human!'
		},
		[5]  = {
			Text = 'See you around, chap!'
		}

	},
	ClearSirBearsHouse = {
		DependentQuest = 'ClearSirBearsHouse',
		[1] = {
			Text = 'Hello again, human!',
			Responses = {
				[1] = {Text = 'I cleared your house for you', Next = 2}
			}
		},
		[2] = {
			Text = 'You did! Jolly Good Show Human!! Tell you what, young chap, come over for tea any time you like! Thank you so much!',

			Responses = {
				[1] = {Text = 'No Problem!', Effect = function() delay(20,function() workspace.Map.NPC.Bear:Destroy()end) end}
			}}
	}
}

return module

anyone know why this could be?

1 Like

I have experienced an error like this only in game aswell! To fix it, I just yielded before requiring the module. Try that & if it doesn’t work lmk.

1 Like

yield how? like a wait statement in the module script, when requiring it or somewhere else?thanks for your help tho

When requiring use task.wait and yield it for 1-3 seconds.

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