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

Text is not changing.Can someone help me?? thanks

Asked by 5 years ago

Hello, I want to make a clicker game but I have a problem. I want to make a text like to show your currency.

Here's my script.

game.Players.PlayerAdded:Connect(function(plr)
        local dp = plr.leaderstats.DP.Value
        while true do
            wait(0.5)
            script.Parent.Text = "Dino Points: "..dp
        end
end)

When I click "Play" nothing happens.The text isn't changing.Can someone help me? The game is FE

0
Cant you try dp.Text = "Dino Points:"..dp??? xXKillerMurderarXx 59 — 5y
0
Not working NathanielFawkes 9 — 5y

2 answers

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

We had a lot of conversation, so you've told me that script wasn't working in the client (game). So I will try to do my best.

-- Make sure that this is a Local Script

local Player = game:GetService("Players").LocalPlayer
local leaderstats = Player:WaitForChild("leaderstats")
local Currency = leaderstats:WaitForChild("DP")

while wait() do
    script.Parent.Text = "Dino Points: "..dp.Value
end

-- ^ Hopeful, this will fix your question ^

0
not working ;-; NathanielFawkes 9 — 5y
0
Anything from the output? AswormeDorijan111 531 — 5y
0
Cuz my code should work fine. AswormeDorijan111 531 — 5y
0
Did you copied from the *view source*? AswormeDorijan111 531 — 5y
View all comments (25 more)
0
Sec, let me update my answer and when I say that i've updated it, copy it and try it AswormeDorijan111 531 — 5y
0
Updated my answer, try it now AswormeDorijan111 531 — 5y
0
I copied it from source but is not working ;-; NathanielFawkes 9 — 5y
0
I just updated it one more time! AswormeDorijan111 531 — 5y
0
Try it now AswormeDorijan111 531 — 5y
0
Thank you this time it works! NathanielFawkes 9 — 5y
0
No problem mate :) AswormeDorijan111 531 — 5y
0
Accept my answer if you want. AswormeDorijan111 531 — 5y
0
I m new so can you tell me how to do that? NathanielFawkes 9 — 5y
0
You have under my answer Accept Answer option, you can just click that :) AswormeDorijan111 531 — 5y
0
Umm I don't have any "Accept Answer" Option http://prntscr.com/kdgnym NathanielFawkes 9 — 5y
0
One sec AswormeDorijan111 531 — 5y
0
Well, it looks like that you aren't the owner of the question, but you are owner... Try looking next to the question on the right side is there anything... AswormeDorijan111 531 — 5y
0
Nothing is on the right side NathanielFawkes 9 — 5y
0
How is this supposed to happen? AswormeDorijan111 531 — 5y
0
Idk NathanielFawkes 9 — 5y
0
Well, at least I helped you. AswormeDorijan111 531 — 5y
0
Yeah NathanielFawkes 9 — 5y
0
I have a big problem now, the script works fine in the studio but when I play the game it isn't working ;-; NathanielFawkes 9 — 5y
0
Not working in the game? AswormeDorijan111 531 — 5y
0
Here, you've probably seen that I updated the answer rn AswormeDorijan111 531 — 5y
0
Working thanks NathanielFawkes 9 — 5y
0
No problem mate :) AswormeDorijan111 531 — 5y
0
So bad that you can't accept the answer cuz i am losing rep AswormeDorijan111 531 — 5y
0
Oh now I accepted it :D NathanielFawkes 9 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Try this:

game.Players.PlayerAdded:Connect(function(plr)
    local dp = plr.leaderstats.DP
    dp.Changed:Connect(function()
    script.Parent.Text = "Dino Points: "..dp
    end)
end)
0
Not working :/ NathanielFawkes 9 — 5y
0
Well, your script would probably work if you've added the .Value after dp. AswormeDorijan111 531 — 5y
0
I added .Value but is still not working NathanielFawkes 9 — 5y
0
Is the parent a TextLabel or not? scopetag 0 — 5y

Answer this question