How should I let the script be able to reveal a value's value?
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:
01 | local player 1 = script.Parent.Parent.Parent.Parent |
02 | local playername = player 1. TradePlayer |
03 | local player 2 = game.Players:WaitForChild(playername.Value) |
05 | local confirmon = false |
08 | if script.Parent.Visible = = true then |
09 | if readyon = = false then |
10 | if player 1. PlayerGui.NotifGUI.Trading.Ready.Text = = "Ready" and player 2. PlayerGui.NotifGUI.Trading.Ready.Text = = "Ready" then |
12 | player 1. PlayerGui.NotifGUI.Trading.Ready.Text = "Confirm" |
13 | player 2. PlayerGui.NotifGUI.Trading.Ready.Text = "Confirm" |
17 | if confirmon = = true then |
18 | if player 1. PlayerGui.NotifGUI.Trading.Ready.Visible = = false and player 2. PlayerGui.NotifGUI.Trading.Ready.Visible = = false then |
21 | local gui 1 = script.Parent |
22 | local gui 2 = player 2. PlayerGui.NotifGUI.Trading |
23 | local sword 1 = gui 1. SwordA |
24 | local sword 2 = gui 1. SwordB |
25 | local sword 3 = gui 1. SwordC |
26 | local sword 4 = gui 1. SwordD |
27 | local sword 5 = gui 1. SwordE |
28 | local othersword 1 = gui 2. SwordA |
29 | local othersword 2 = gui 2. SwordB |
30 | local othersword 3 = gui 2. SwordC |
31 | local othersword 4 = gui 2. SwordD |
32 | local othersword 5 = gui 2. SwordE |
33 | if not sword 1. Text = = "Empty Slot" then |
34 | player 1. StarterGear:WaitForChild(sword 1. Text):Destroy() |
36 | if not sword 2. Text = = "Empty Slot" then |
37 | player 1. StarterGear:WaitForChild(sword 2. Text):Destroy() |
39 | if not sword 3. Text = = "Empty Slot" then |
40 | player 1. StarterGear:WaitForChild(sword 3. Text):Destroy() |
42 | if not sword 4. Text = = "Empty Slot" then |
43 | player 1. StarterGear:WaitForChild(sword 4. Text):Destroy() |
45 | if not sword 5. Text = = "Empty Slot" then |
46 | player 1. StarterGear:WaitForChild(sword 5. Text):Destroy() |
48 | if not othersword 1. Text = = "Empty Slot" then |
49 | local tool = game.ReplicatedStorage.GameItems:WaitForChild(othersword 1. Text):Clone() |
50 | tool.Parent = player 1. StarterGear |
52 | if not othersword 2. Text = = "Empty Slot" then |
53 | local tool = game.ReplicatedStorage.GameItems:WaitForChild(othersword 2. Text):Clone() |
54 | tool.Parent = player 1. StarterGear |
56 | if not othersword 3. Text = = "Empty Slot" then |
57 | local tool = game.ReplicatedStorage.GameItems:WaitForChild(othersword 3. Text):Clone() |
58 | tool.Parent = player 1. StarterGear |
60 | if not othersword 4. Text = = "Empty Slot" then |
61 | local tool = game.ReplicatedStorage.GameItems:WaitForChild(othersword 4. Text):Clone() |
62 | tool.Parent = player 1. StarterGear |
64 | if not othersword 5. Text = = "Empty Slot" then |
65 | local tool = game.ReplicatedStorage.GameItems:WaitForChild(othersword 5. Text):Clone() |
66 | tool.Parent = player 1. StarterGear |
68 | player 1 :LoadCharacter() |
69 | player 2 :LoadCharacter() |