Functions inside other functions?

local leaderstats ="Folder", plr)
	leaderstats.Name = "leaderstats"
	local cashv ="IntValue", leaderstats)
	cashv.Name = "Cash"
	cashv.Value = plrData.Cash
		plrData.Cash = cashv.Value

Would the cashv.Changed function prevent anything further in the script from running correctly?

No? Why would it?

Just making sure.

A way to answer this without needing to ask is to check on DevHub to see if it says it yields.

Stuff like loops, waits (obviously) and a few other things will yield scripts unless wrapped in coroutines/spawn (spawn isn’t the best idea, use coroutines if you must)

Events will never yield or interrupt the current thread.

1 Like