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

I have problems with Value how to fix that?

Asked by 5 years ago

Code: (LocalScript)

local MainFrame = script.Parent.Main
local FindPlayerFrame = MainFrame.FindPlr
local PlrBox = FindPlayerFrame.PlrBox.Box
local FindBTN = FindPlayerFrame.Find
local SS = game:GetService("ServerStorage")

local NameBox = MainFrame.PlayerName
local ClassBox = MainFrame.Class
local BreakfastBox = MainFrame.Breakfast
local LunchBox = MainFrame.Lunch
local DinnerBox = MainFrame.Dinner
local DrinkBox = MainFrame.Drink

FindBTN.MouseButton1Click:connect(function()
     if SS:FindFirstChild(PlrBox.Text) then
    NameBox.Text = ("Name: " ..SS:FindFirstChild(PlrBox.Text).PlrName.Value)
    ClassBox.Text = ("Class: " ..SS:FindFirstChild(PlrBox.Text).Class.Value)
    BreakfastBox.Text = ("Breakfast: " ..SS:FindFirstChild(PlrBox.Text).Breakfast.Value)
    LunchBox.Text = ("Lunch: " ..SS:FindFirstChild(PlrBox.Text).Lunch.Value)
    DinnerBox.Text = ("Dinner: " ..SS:FindFirstChild(PlrBox.Text).Dinner.Value)
    DrinkBox.Text = ("Drink: " ..SS:FindFirstChild(PlrBox.Text).Drink.Value)
end
end)

I don't know my mistake and I checked Dev Console. I not found mistakes in Client Log and Server Log

I'm checked for folder and folder is exist. In Studio it work.

0
Studio turns every script and local script secretly into a Module script, which is both Local and Server mixed. If it only works on Studio, try making it a server script. mudathir2007 157 — 5y
0
I'm needed to use RemoteEvents or RemoteFunctions? User#22595 0 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

You need to use Value.Value. The Value itself is just a holder of your actual Value if that makes any sense.

Ad
Log in to vote
0
Answered by 5 years ago

This is because you’re using ServerStorage from the client.

In studio’s play solo mode, there is no separation of the server and client, so that’s why it may work in studio. Instead, move your objects from server storage to ReplicatedStorage.

And in lines 16-21, you wrapped your strings in brackets, which errors since brackets are math exclusive. Remove the brackets.

In line 14, you used deprecated code. It’s :Connect(), not :connect().

Answer this question