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

How should I let the script be able to reveal a value's value?

Asked by 3 years ago

So I'm making a trading system for Evercyan's RPG Kit and I noticed a problem. My script wasn't detecting a value's value. Here is the script:

01local player1 = script.Parent.Parent.Parent.Parent
02local playername = player1.TradePlayer
03local player2 = game.Players:WaitForChild(playername.Value)
04local readyon = false
05local confirmon = false
06while true do
07    wait()
08    if script.Parent.Visible == true then
09    if readyon == false then
10        if player1.PlayerGui.NotifGUI.Trading.Ready.Text == "Ready" and player2.PlayerGui.NotifGUI.Trading.Ready.Text == "Ready" then
11            readyon = true
12            player1.PlayerGui.NotifGUI.Trading.Ready.Text = "Confirm"
13            player2.PlayerGui.NotifGUI.Trading.Ready.Text = "Confirm"
14            confirmon = true
15        end
View all 73 lines...
0
what value? tell me the line too. btw use "local player1 = game.Players.LocalPlayer" instead of that messy one (bad practice) acediamondn123 147 — 3y
0
It's not a local script and playername is the value. For some reason when it does have a value and I print it's value it says it's "" for no reason at all. CandyWreckEpicness 115 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

I realized my mistake. You have to put it after the if visible thing.

01local readyon = false
02local confirmon = false
03while true do
04    wait()
05    if script.Parent.Visible == true then
06        local player1 = script.Parent.Parent.Parent.Parent
07        local playername = script.Parent.Parent.Parent.Parent.TradePlayer.Value
08        local player2 = game.Players:WaitForChild(playername)
09        if readyon == false then
10            if player1.PlayerGui.NotifGUI.Trading.Ready.Text == "Ready" and player2.PlayerGui.NotifGUI.Trading.Ready.Text == "Ready" then
11                readyon = true
12                player1.PlayerGui.NotifGUI.Trading.Ready.Text = "Confirm"
13                player2.PlayerGui.NotifGUI.Trading.Ready.Text = "Confirm"
14                confirmon = true
15            end
View all 73 lines...
Ad

Answer this question