local Player = game:GetService("Players").LocalPlayer
local TextLabel = Player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("Frame"):FindFirstChild("TextLabel")
local Number = 0.0035
local textbox = script.Parent
textbox.FocusLost:Connect(function(enter)
if tonumber(script.Parent.Text) then
print(script.Parent.Text * Number)
end
end)
TextLabel.Text = textbox
Notice, instead of this - local TextLabel = Player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("Frame"):FindFirstChild("TextLabel")
You could simply assign it as you did to your textbox. Just assign it to where its currently located , but dont use StarterGui.
Note
This will only make the change to the client, not to the whole server.
You should get every players gui and change the textlabel.
StarterGui service is only used to change the gui that will be shown to the player when it joins or respawns.
To change a gui while playing you should acces the client’s gui.
You could change every player’s gui with remote events or a for loop.
the easiest way to do it is with a foor loop.
for i, players in ipairs(game.Players:GetChildren()) do
players.PlayerGui.ScreenGui.Frame.TextLabel.Text = tonumber(script.Parent.Text * numb)
end
Note that using this method makes the server change the gui of every player so if you edit it from client side the script wont thake those changes into consideration.
Hi @Valkyrop, I’ve tried your code in Roblox Studio but sadly it didn’t work. I placed the code (Local Script) inside the “Textbox”. Let me know if I placed the local script in the wrong place.!
I’ve tried this code in Visual Studio Code and it worked perfectly…!: