Script goes fine, but when player resets or respawns the value goes back to 0. Any help or suggestions?
[Local Script in screen GUI inside text label]
1 | local player = game.Players.LocalPlayer |
2 | local crops = player.Inventory:WaitForChild( "Crops" ) |
3 |
4 | crops:GetPropertyChangedSignal( "Value" ):Connect( function () |
5 | script.Parent.Text = crops.Value |
6 | end ) |
This is actually not a script problem. Do these instructions
Click on the ScreenGUI and unclick ResetOnSpawn. Simple
Maybe a while true do loop
01 | local player = game.Player |
02 | local crops = player.Inventory:WaitForChild( "Crops" ) |
03 |
04 |
05 | function Update() |
06 | script.Parent.Text = crops.Value |
07 | end |
08 |
09 |
10 | while true do |
11 | Update() |
12 | end |