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

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

Asked by
danglt 185
5 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

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
Use a remote event to fire to a server script to change the text XviperIink 428 — 5y

1 answer

Log in to vote
5
Answered by
yHasteeD 1819 Moderation Voter
5 years ago
Edited 5 years ago

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.
Ad

Answer this question