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

Why is this saying "Player1 is not a valid member of StringValue?"

Asked by
Asigkem 32
7 years ago

I have a script that sends a request once a string value called "DuelRequest" is added to a folder.

script.Parent.Requests.ChildAdded:connect(function(request)
    if request:IsA("StringValue") and request.Name == "DuelRequest" then

        for _,v in pairs(request:GetChildren()) do
        print(v.Name)
        end

        send_request(request)
    end
end)

--The line of code where problems are occuring in the send_request function is below:

request_frame.DuelInformation.Text = 
("You have been challenged by "..duel.Player1.Value .. " to a duel. This will be played until you or your opponent die " .. tostring(duel.MaxDeaths.Value) .." times.")

I keep getting the following output:

Player1
Player2
Location

Player1 is not a valid member of StringValue.

So it clearly is a valid member of StringValue since I ran a bit of code just before it to check... yet this script for some reason tells me it is not and then therefore fails to send a request.

0
you should probably add a wait() for a while on the first line :P the best i can do greatneil80 2647 — 7y
0
Can you show the code for `send_request`? It's hard to answer your question without knowing how variable `duel` is defined. MightyBaconOverlord 253 — 7y
0
Use :WaitForChild(), maybe? hiimgoodpack 2009 — 7y
0
Use :WaitForChild(), maybe? hiimgoodpack 2009 — 7y
0
Did you figure out the code? I am also having trouble similar to your script. User#27966 0 — 5y

Answer this question