✓ Accepted answer
Yes, you can make this FE, Using RemoteEvents
example:
local remote = game.ReplicatedStorage.RemoteEvent
remote.OnServerEvent:Connect(function(player, arg)
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)
local remote = game.ReplicatedStorage.RemoteEvent
script.Parent.MouseButton1Click:Connect(function()
remote:FireServer("Hi")
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
function click()
local mess = script.Parent.Parent.TextBox
script.Parent.Parent.TextBox.Text = "Please Wait 5 Seconds"
event:FireServer("ChangeText",mess.Text)
script.Parent.Parent.TextBox.Text = ""
end
script.Parent.MouseButton1Click:Connect(click)
Server Script(Script, Remote Event Script)
local event = game.ReplicatedStorage.RemoteEvent
event.OnServerEvent:Connect(function(player,arg,text)
if arg == "ChangeText" then
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.
1 comment
Use a remote event to fire to a server script to change the text