The title explains it all.

This script seems to be correct.

All both (script.Parent.Parent.Money.Value) & (script.Parent.Parent.Storage.Value) are IntValues!

script.Parent.Parent.Money.Changed:Connect(function()
	print("yolo")
	if script.Parent.Parent.Money.Value >  script.Parent.Parent.Storage.Value then
		print("yolo2")
		script.Parent.Parent.Money.Value =  script.Parent.Parent.Storage.Value
		print("yolo3")
	end
end)

Any help would be appreciated!

10 comments

0

is the Money value greater than the Storage value? Does it print "yolo"?

0

Prints nothing at all.

0

Do i need to use a event and a local script to access leaderstats?

0

If leaderstats is inside the player object the local script should be able to access it without remote events. The prints are not working because its connected to a Changed event, meaning that the Money value has to be changed in order for the function to run.

0

Is this code from a server script or local script?

0

Where is the script located? Are there any errors in the output?

0

Server Script. & Its only supposed to check if the money is changed ok.

0

No errors.

0

Run studio again, switch to server mode and change the Money's value. It should print since this is a server script

1

So this script is inside some folder that itself is inside leaderstats, do i have this right?