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

Have troubles with a text box gui, can someone help?

So I did make a question earlier today asking why the intvalue randomiser wasn't working, the problem now is that I need the player to type "Makato Naegi" To go to the next level, but whenever I test it nothing happens, I suspect line 12 is the problem, but i am not sure.

local ss = game:GetService("ServerStorage")
local dl = ss:WaitForChild("Decals")
local v = script.Parent.Value

v.Value = math.random(1,2)

print(v.Value)

if v.Value == 1 then
	script.Parent.Image = ss.Decals.MakatoNaegi.Texture
	print("MakatoNaegi Choosen!")
	if script.Parent.Parent.TextBox.Text == "Makato Naegi" then
		script.Parent.Image = ss.Decals.Tick.Texture
		
		end
		v.Value = 0
		if v.Value == 0 then
			v.Value = math.random(1,10)
	end
end

4 comments

0

if script.Parent.Parent.TextBox.Text == ("Makato Naegi")

0

Doesn't work.

0

The no output is most likely because the script is immediately checking the text input, and not waiting until the player clicks off the text box.

1 answer

I can safely assume this is a server script because of this line

local ss = game:GetService("ServerStorage")

unless ur just bad... anyways, local guis can not be accessed by the server sorry, easy fix tho, put a remote event in replicated storage and call it, using removtevent:FireClient(plr.Name). then returning whats in the textbox using the same remote event, and by the way you can use paremeters to send over data like whats in a textbox, then just listen to that same remote event server side and boom you have the textbox's text but you cant pull it directly from the client using the server.

1 comment

0

I see, I don't usually use remote events, but now is a good time to.

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