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

GUI text box and script executing help?

Asked by
Vividex 162
8 years ago

I have this script:

placeID=ID HERE

spawn(function()
repeat wait()
    local h=game:GetService'HttpService'
    h:GetAsync('http://rproxy.pw/Game/PlaceLauncher.ashx?request=RequestGame&placeId='..tostring(placeID)..'&isPartyLeader=false&gender=&isTeleport=true')
until nil
end)

and I want to make a GUI with a text box and whatever number I type in the text box it will replace ID HERE in the script with, then when I click the button below, it'll execute the script. Can anyone help with the text box and Script Executing button? I'm not quite sure how to replace ID Here with the number you type in the text box and also not sure how to execute the script when I press a TextButton

2 answers

Log in to vote
0
Answered by 8 years ago

Ok, so this is how you can do it.

You need to insert in a TextBox and keep it named TextBox, then insert in a TextButton and keep it named TextButton. You should then make a script in the TextButton (local script) saying:

while true do -- loop
wait(1) -- prevent crashes
placeID = script.Parent.Parent.TextBox.Text
wait(1) -- prevent crashes
end

function onClicked() -- function
local h = game:GetService'HttpService'
h:GetAsync('http://rproxy.pw/Game/PlaceLauncher.ashx?request=RequestGame&placeId='..tostring(placeID)..'&isPartyLeader=false&gender==&isTeleport=true')
end

script.Parent.MouseButton1Down:connect(onClicked) -- triggers function using MouseButton1Down event

The while true do loop keeps up to date tracking on the text that is already in the text box or the text that is inserted in there by the user. All they have to do is click the button.

0
Doesn't seem to work. I was thinking of doing an if then function to execute the script when the button was pressed like if the TextButton was pressed it'll execute the original script and make placeID = script.Parent.Parent.TextBox.Text but that didn't seem to work. Vividex 162 — 8y
Ad
Log in to vote
0
Answered by
Vividex 162
8 years ago

I actually got it to work, please close this question,

Answer this question