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

How to make a player GUI go into a Value in workspace?

I tried to make this script but I know it won't work, can you guys show me how to make a remote event for this please thanks!

while true do
game.Workspace.thing.Value = game,Players.superbolt999.PlayerGUI.Answer.Frame.Q1.Text
wait(1)
end

thing is a string value in workspace keep superbolt999 since that is all that will be using this game.

2 comments

0

try using a GetPropertyChanged signal function and a Remote Event instead of an infinite loop

0

game,Players?

1 answer

✓ Accepted answer

Not sure why do you need to set a value in workspace to a text from a player's gui. Generally you shouldn't do that, but since you didn't provide any more details, do the following:

Connect to the Q1:GetPropertyChangedSignal("Text") event of the Q1. Inside the event handler fire a remote which will set the value of the "thing" to the text.

Example: Client

local plr = game:GetService("Players").LocalPlayer
local remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

local Q1 = plr.PlayerGui.Answer.Frame.Q1
Q1:GetPropertyChangedSignal("Text"):Connect(function()
	remote:FireServer(Q1.Text)
end)

Server

local remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

remote.OnServerEvent:Connect(function(plr, text)
	workspace.thing.Value = text
end)

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