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

Code Not Working?

I am putting a "Riddle Code" into my place. Basically, if the user puts the right code in the txt box and presses ENTER, and they haven't placed the code before, they get 200 points.

function onClicked(player)
	local player = game.Players.LocalPlayer
	
		if script.Parent.Parent.TextBox.Text == "bloxvortex" then
		if player.riddlecodetrue == 0 then
			player.leaderstats.Points.Value = player.leaderstats.Points.Value + 200
			script.Parent.Parent.TextBox.Text = "The Answer was Correct! +200 Points!" 
			player.riddlecodetrue = 1
		end
	else
		script.Parent.Parent.TextBox.Text = "The Answer was Already Entered."
	end
end

script.Parent.MouseButton1Click:connect(onClicked)

7 comments

0

What's the error?

0

when I put in the answer, nothing happens.

0

Check the output and see if there is a error.

0

There is no error in output. It does say " 21:37:57.501 - This function is not yet enabled!" but that has nothing to do with my script.

0

And yes, its a localscript.

0

That's from an admin script.

0

?

1 answer

✓ Accepted answer

The issue is the fact that riddlecodetrue isn't a valid property of player objects - I do believe you're intending to edit the value of a value object named "riddlecodetrue", therefore you need to change:

player.riddlecodetrue

To:

player.riddlecodetrue.Value 

1 comment

0

(I like your username). And thanks. I make this problem every time. :D

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