Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have problems with Value how to fix that?

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.

2 comments

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.

0

I'm needed to use RemoteEvents or RemoteFunctions?

2 answers

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

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().

This discussion is preserved as it was. New answers, comments, and votes are closed.