Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Enum.TweenStatus.Completed function not working correctly?

I need help with using "TweenStatus" I need it to fire a function once the bar has completed I tried to get it to fire a function but it gave me this error:

11:33:39.180 - Unexpected error while invoking callback: Enum cannot be modified

and

11:33:39.178 - Enum cannot be modified

What do these mean and how could I fix them?

script.Parent.Grunt.Progress:TweenSize(UDim2.new (0,50,0,8), Enum.EasingDirection.In,Enum.EasingStyle.Linear,2,true, function(M)Enum.TweenStatus.Completed = function (G)  




function M()
	print "Working"
end

function G()
	print "Troop Made" --Make troop
end

end
end)
end)

1 answer

✓ Accepted answer

You're trying to modify a global http://wiki.roblox.com/index.php?title=Enumeration.

It seems like you're trying to check whether the tween completed. For this, you would do:

script.Parent.Grunt.Progress:TweenSize(UDim2.new (0,50,0,8), Enum.EasingDirection.In,Enum.EasingStyle.Linear,2,true, function(M)
	if M == Enum.TweenStatus.Completed then
		print "Working"
		print "Troop Made" --Make troop
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.