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

why does this script not print the player's PlayTime value. how can I fix this?

Asked by 3 years ago

wassup

my script isn't working and I tried everything I could.

can anyone help me ? it's supposed to print out "Value = (number)".

I'm new to coding so any help will do. ty.

script:

show = print
plr = game.Players.LocalPlayer

if show = print then
show ("Value = " plr.leaderstats.PlayTime.Value)
end

1 answer

Log in to vote
0
Answered by 3 years ago

Hey there!

Try using the following code:

show = print
player = game.Players.LocalPlayer

if show = print then
show ("Value = "..player.leaderstats.PlayTime.Value) -- You need to add two dots between each statement, that's the easiest way I can explain it to you as a beginner.
end


-- Also I changed the variable "plr" to "player" to make it easier to read.

If it worked, please mark this answer as solved! Thank you!

0
it worked tysm dude balooncool 6 — 3y
0
Glad it worked! No problem! SonGohan6 85 — 3y
Ad

Answer this question