i ahve a script that when u press a button wat ever is in the textbox will appear on a brick but because of FE only i can see it can anyone tell me how i can do this?
function click() local mess = script.Parent.Parent.TextBox.Text script.Parent.Parent.TextBox.Text = "Please Wait 5 Seconds" game.Workspace.Message.SurfaceGui.Frame.words.Text = mess wait(5) game.Workspace.Message.SurfaceGui.Frame.words.Text = "" script.Parent.Parent.TextBox.Text = "" end script.Parent.MouseButton1Click:Connect(click)
example:
-- Server local remote = game.ReplicatedStorage.RemoteEvent remote.OnServerEvent:Connect(function(player, arg) -- Got player fired the event, and argument send print("I fired by: " .. player.Name .. " this player send me the argument: " .. tostring(arg)) if arg == "CreatePart" then print("Creating a part...") local part = Instance.new("Part") part.Name = "Part - Remote" part.Parent = workspace print("Created Part") end end) -- Client local remote = game.ReplicatedStorage.RemoteEvent script.Parent.MouseButton1Click:Connect(function() remote:FireServer("Hi") -- Here you dont need to send player. end)
Create a RemoteEvent in ReplicatedStorage, now insert a ServerScript in ServerScriptService.
Client(Local Script, Fire Event)
local event = game.ReplicatedStorage.RemoteEvent -- Remote Event Location function click() local mess = script.Parent.Parent.TextBox -- Removed the .Text script.Parent.Parent.TextBox.Text = "Please Wait 5 Seconds" event:FireServer("ChangeText",mess.Text) -- Text and argument send here to server. script.Parent.Parent.TextBox.Text = "" end script.Parent.MouseButton1Click:Connect(click)
Server Script(Script, Remote Event Script)
local event = game.ReplicatedStorage.RemoteEvent -- Remote Event Location event.OnServerEvent:Connect(function(player,arg,text) -- On fire event if arg == "ChangeText" then -- Check for argument -- Change Text workspace.Message.SurfaceGui.Frame.words.Text = tostring(text) wait(5) workspace.Message.SurfaceGui.Frame.words.Text = "" end end)
Hope it helped :)
Wiki pages: