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

Command not displaying total hours?

Asked by 3 years ago

When *;hours * is ran, the value says 0 but I clearly have more than 0 hours. Help is appreciated, thanks!

local DatastoreService = game:GetService("DataStoreService")

local player = game.Players.LocalPlayer
local hoursValue= Instance.new("NumberValue", player)

player.Chatted:Connect(function(msg)
            if msg == ";hours" then 

                        wait(0.1)

                        game.StarterGui:SetCore('ChatMakeSystemMessage', {
                                                Text = "You have " .. hoursValue.Value .. " Total hours";
                            Color = Color3.fromRGB(76, 255, 0);
                            Font = Enum.Font.SourceSansLight;
                            TextSize = 20;
                        })  
        end

end)

1 answer

Log in to vote
-1
Answered by 3 years ago

This

local hoursValue= Instance.new("NumberValue", player)

should be

local hoursValue = Instance.new("NumberValue", player)

0
that's not fixing my problem tho vhixloqan 2 — 3y
Ad

Answer this question