I have been trying to get text from a TextBox but it doesnt work for some reason.
This is a script.
if mode.Value == 5 then --Color
local color = player.PlayerGui.LoadoutGui.Loadout.SpawnMenu.Loadout.RGB.Text
if target.Locked == false then
target.Color = Color3.fromRGB(color)
print(color)
end
end
end
I suggest you add more checks to see if the code is really running example[should be used as an example]:
if mode.Value == 5 then --Color
print("The vaule is 5")
local color = player.PlayerGui.LoadoutGui.Loadout.SpawnMenu.Loadout.RGB.Text
print(color)
if target.Locked == false then
print("target is locked")
target.Color = Color3.fromRGB(color)
print(color)
end
end
end
I already tried and it had the same problem.
It literally just doesnt want to work.
local RGB = player.PlayerGui:WaitForChild("LoadoutGui")
local RGB1 = RGB.Loadout.SpawnMenu.Loadout.RGB.Text
task.spawn(function()
while true do
value.Value = RGB1
print(value)
wait(0.1)
end
end)
Also, you can’t do Color3.fromRGB(text) as you cant use a string for a color. Separate the string using string.split(text, ",") and use these values instead.
Ok, so you have a RemoteEvent instance.
The client can do:
RemoteEvent:FireServer(data)
data being the thing the player sends
The server can do:
RemoteEvent.OnServerEvent(function(player, data)
-- stuff here
end)
Connect an event that does stuff everytime the client does their thing, automatically receiving the Player instance of who did it and the data.
For your case you would check with the textbox’s event that lets you detect when the player inputs something in it and it would FireServer and the server can handle it.