Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is checking if an IntValue is changed not working?

Asked by 5 years ago

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!

0
is the Money value greater than the Storage value? Does it print "yolo"? hellmatic 1523 — 5y
0
Prints nothing at all. kittonlover101 201 — 5y
0
Do i need to use a event and a local script to access leaderstats? kittonlover101 201 — 5y
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. hellmatic 1523 — 5y
View all comments (6 more)
0
Is this code from a server script or local script? hellmatic 1523 — 5y
0
Where is the script located? Are there any errors in the output? liuthemoo 45 — 5y
0
Server Script. & Its only supposed to check if the money is changed ok. kittonlover101 201 — 5y
0
No errors. kittonlover101 201 — 5y
0
Run studio again, switch to server mode and change the Money's value. It should print since this is a server script hellmatic 1523 — 5y
1
So this script is inside some folder that itself is inside leaderstats, do i have this right? SerpentineKing 3885 — 5y

Answer this question