local remote = game.ReplicatedStorage.Remotes.execute
remote.OnServerEvent:connect(function()
loadstring(game.StarterGui.ScreenGui.Frame.require.Text)
end)
I have made an execute gui for serverside modules/basic scripts. When I try it, there is no output.
Yes, I made a script inside the button to fire the remote when clicked. That part is fine, it doesn't execute anything though.
And I did see something. When you go to the properties of the TextBox, and then type text in the box in-game, it doesn't show in properties.
You're first problem is that you're trying to access the Players textbox from the server by accessing the StarterGui.
The StarterGui is the place where you put your GUI which will get cloned into the players PlayerGui when they spawn. Another problem is that you cannot access the contents of the PlayerGui from the server.
What you'll want to do is pass the Text from the client, to the server via arguments in your Remote Event.
-- On both the Client and Server local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("execute") -- Client local TextBox = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("Frame"):WaitForChild("require") RemoteEvent:FireServer(TextBox.Text) -- Server RemoteEvent.OnServerEvent:Connect(function(Player, Text) loadstring(Text) end)
I'd recommend a remote event to do this for you, you should try something like:
--first make a remote yourremote.OnServerEvent:connect(function(LocalPlayer) if LocalPlayer.UserId == 'your user id here' then loadstring(tostring(LocalPlayer.PlayerGui.your textbox path.Text)) else LocalPlayer:Kick() end
Exploiters won't be able to backdoor and it serves the same function as what you are trying to do. PS: You could have also just used F9 server console.