Important Scripts Not Working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want my scripts to be able to work (they change the text based off of player values in a PlayerGUI)

  2. What is the issue? My scripts (they change the text based off of player values in a PlayerGUI) are not working

  3. What solutions have you tried so far? I have been trying everything I can to fix them to no avail

Here are the scripts in question that are not working (all of them are LocalScripts)


local player = game.Players.LocalPlayer
local raagh = player:FindFirstChild("Challenges")
if raagh["three"].Value == 1 then
	wait(.01)
	script.Parent.Text = "Lava Jumps"
elseif raagh["three"].Value == 2 then
	wait(.01)
	script.Parent.Text = "Laser Time"

elseif raagh["three"].Value == 3 then
	wait(.01)
	script.Parent.Text = "Crazy Checkers"
end
--this is for IntValues one, two, and three (supposed to check what games you randomly received and update the text)
local player = game.Players.LocalPlayer
local raagh = player:FindFirstChild("DoneCheck")
local DoneOne = raagh["DoneOne"]

if DoneOne.Value == 0 then
	wait(.01)
	script.Parent.LocalScript.Enabled = true
elseif DoneOne.Value == 1 then
	wait(.01)
	script.Parent.BackgroundColor3 = Color3.fromRGB(81,81,81)
	script.Parent.TextColor3 = Color3.fromRGB(181,181,181)
	script.Parent.Text = "Completed"

	print("SPARE RIBS")

end
--these are for IntValues DoneOne, DoneTwo, and DoneThree (supposed to check when its done and update the text)

I do not know what’s going on, I’ve tried everything to get the text to update but it is inconsistent and doesn’t work. I would appreciate all the help I can get, as this is urgent and I need to fix it ASAP.

Edit: The “Coin Games” are in separate places within the same experience, hence why I am using this system.

3 Likes

You know that these scripts only run when the player respawns or first goes in the game?

I’m not sure what exactly you are doing even after reading it, but I would say try something like this.

raagh:GetPropertyChangedSignal("Value"):Connect(function()
	if raagh["three"].Value == 1 then
		wait(.01)
		script.Parent.Text = "Lava Jumps"
	elseif raagh["three"].Value == 2 then
		wait(.01)
		script.Parent.Text = "Laser Time"

	elseif raagh["three"].Value == 3 then
		wait(.01)
		script.Parent.Text = "Crazy Checkers"
	end
end)
DoneOne:GetPropertyChangedSignal("Value"):Connect(function()
	if DoneOne.Value == 0 then
		wait(.01)
		script.Parent.LocalScript.Enabled = true
	elseif DoneOne.Value == 1 then
		wait(.01)
		script.Parent.BackgroundColor3 = Color3.fromRGB(81,81,81)
		script.Parent.TextColor3 = Color3.fromRGB(181,181,181)
		script.Parent.Text = "Completed"

		print("SPARE RIBS")
	end
end)
2 Likes

Yeah, I probably should have put that the coin games are in other places. The values are updated upon rejoining, but the textboxes are not.

1 Like

Are the DoneOne and raagh values being saved in a datastore?

1 Like

Yes, all of the datastore and value parts are all working. It is the textboxes in the PlayerGUI that each player receives upon joining that doesn’t update.

Does the textboxes update if your player resets? Maybe the values aren’t loading before the textbox change runs?

Also, are you using a TextBox or a Textlabel? Textboxes allow users to edit the text inside unless property is unchecked.

I’m using textlabels for game titles and textbuttons for the play buttons.

What about this? I am not really sure if it doesn’t update apon respawning.

Forgot to address that. I do not believe respawning has an effect on it.

Have you tried printing in the if statements?

It is supposed to print “SPARE RIBS” for the done checker, but it does not do that. The values are updated though, since it prints that in the other scripts that handle values (which work perfectly, it is only the ones that concern the textbuttons/textlabels).

I’m saying try printing in every if statement to see if it even runs it.

I’ve seem to have gotten the buttons to work, but the text labels still do not change. None of the messages were printed it seems, even though the value itself is at two; theres no error, no output, no nothing. Here is a visual of the script vs the value (this was screenshotted while playtesting in studio):

Are you able to show the location of the script through a screenshot?

The highlighted script in the explorer on the right is the location of one of the scripts. It now shows two of the three as working, which is how it has been: very inconsistent.

Can you please explain what is suppose to happen? I am very confused about all this.

So, each “coin game” is randomized out of three different options. Each option has three different difficulties (hence why theres a one, two, and three for easy, medium, and hard respectively). The chosen game is supposed to show its name in the dark gray text box. However, each time I leave and rejoin, the coin games dont seem to load in properly; some of them dont show as completed when completed (which is set up in the second script i listed) and some of the titles show as the filler text instead of the title of the game (which is set up in the first script). I am trying to make it so that they all register instead of just some (or none at all sometimes), yet it only seems like these scripts are being problematic. I just need a way to get all the text to properly register.

How do you check when one is completed ? Is there only two values?

There is other scripts to check that using IntValues (0s for undone, 1s for done), but the weird thing is that those are working perfectly fine. It’s only the text display that seems to be acting up, regardless of the value.

my english is bad, sry, wish you could understand what i am saying.

add a print after every WaitForChild() may help if you didn’t pass a time param.
I had a similar problem before and I found my script suspended because there is no end for waiting a child.

I guess you should let your character wait for that value, not your local player, localplayer.Character:WaitForChild()