Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

2 comments

0

Cant you try dp.Text = "Dino Points:"..dp???

0

Not working

2 answers

✓ Accepted answer

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 ^

29 comments

0

not working ;-;

0

Anything from the output?

0

Cuz my code should work fine.

0

Did you copied from the view source?

0

Sec, let me update my answer and when I say that i've updated it, copy it and try it

0

Updated my answer, try it now

0

I copied it from source but is not working ;-;

0

I just updated it one more time!

0

Try it now

0

Thank you this time it works!

0

No problem mate :)

0

Accept my answer if you want.

0

I m new so can you tell me how to do that?

0

You have under my answer Accept Answer option, you can just click that :)

0

Umm I don't have any "Accept Answer" Option http://prntscr.com/kdgnym

0

One sec

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...

0

Nothing is on the right side

0

How is this supposed to happen?

0

Idk

0

Well, at least I helped you.

0

Yeah

0

I have a big problem now, the script works fine in the studio but when I play the game it isn't working ;-;

0

Not working in the game?

0

Here, you've probably seen that I updated the answer rn

0

Working thanks

0

No problem mate :)

0

So bad that you can't accept the answer cuz i am losing rep

0

Oh now I accepted it :D

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)

4 comments

0

Not working :/

0

Well, your script would probably work if you've added the .Value after dp.

0

I added .Value but is still not working

0

Is the parent a TextLabel or not?

This discussion is preserved as it was. New answers, comments, and votes are closed.