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

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

Asked by
bailley5 114
3 years ago

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
0
if script.Parent.Parent.TextBox.Text == ("Makato Naegi") Hafrew 16 — 3y
0
Doesn't work. bailley5 114 — 3y
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. ChickwensRule 2 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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.

0
I see, I don't usually use remote events, but now is a good time to. bailley5 114 — 3y
Ad

Answer this question