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

Is there a way i can make this script compatable with FE?

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)

1 comment

1

Use a remote event to fire to a server script to change the text

1 answer

✓ Accepted answer

Yes, you can make this FE, Using RemoteEvents

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)

For your problem is here fixed script:

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:

Remote Events / Functions

Solved your problems? put [SOLVED] in title, or accept a answer.

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