I need to learn how to run fireserver inside of a module script my script:
RemoteEvent:FireServer(Plr, Message)
(what it does is make a player say something)
I need to learn how to run fireserver inside of a module script my script:
RemoteEvent:FireServer(Plr, Message)
(what it does is make a player say something)
Just out of curiosity, why doesnāt the code you posted work inside a ModuleScript? I believe it should function normally, as long as you reference the RemoteEvent correctly.
Are you requiring the module from a Server, or Local Script? Essentially happens when you require() a ModuleScript, is it loads the ModuleScript code into into the LocalScript/ServerScript you required it from for use.
i am requiring from a module script
What is requiring the module that is requiring the module? ModuleScriptās do not run unless they are called to by a Server or Local Script.
i require it my executing it in the f9 console
Are you executing it to run on the Server, or the Client? Can I see where you are running it exactly?
yes but i donāt know exactly what you mean
He said he was doing it from the DevConsole, so the server, OP I suggest you use BindableEvents then
how would I do that exactly? I donāt know how
Show me the code then, so I can see exactly what it does
[āchatā] = function(ā¦)
local Arguments = {ā¦}
if Arguments[1] == āGETINFOā then return {"Chat [Plr] [Message] ",āForces a player to chat.ā,āAdminā} end
local LocalPlr,ExplodedText = Arguments[1],Arguments[2]
local Targets = ConvertPlayersFromText(ExplodedText[1],LocalPlr)
local Message = āā
for I,Text in pairs(ExplodedText) do
if I ~= 1 then
Message = Messageā¦(Text)
end
if I < #ExplodedText and I > 1 then
Message = Messageā¦" "
end
end
for _,Plr in pairs(Targets) do
local lol = script.Items.chathax.Message
lol.Value = Message
script.Items.chathax.RemoteEvent:FireServer(Plr, Message.Value)
end
end,
The developer console runs code on the server, so you canāt use a RemoteEvent.
Instead of using a RemoteEvent which is for client to server communication, use a BindableEvent, whoās perpose is to send information from server to server.
To fire the event you use:
BindableEvent:Fire(Plr, Message)
To receive the event you use:
BindableEvent.Event:Connect(function(Plr, Message)
end)
trying it now thanks for helping
one problem i need to use onserverevent with the event. Bindable event dosent have that.
You use .Event in the place of .OnServerEvent. It does the exact same thing as .OnServerEvent, but is for BindableEventās.