Hi, everybody. Today, something horrible happened to me—my code didn’t work. I don’t understand, why? Why does it not work? Please, someone, tell me.
I am trying to achieve a custom Remote module to make two-way communication easier.
The following is the ModuleScript code:
local module={
function module.FireRemote(remote:remoteevent,data,target:player)
if game:service'RunService':IsClient then
remote:FireServer(data)
else
remote : fireClients(target,data)
end;
end
The following is the LocalScript code:
local module = game.Players.ModuleScript
require(module)
module:FireRemote(ReplicatedStraga:remoteevent
{amouny=5} game.Players.LocalPlayer)
Why, why did this have to happen to me… Just why… I don’t understand. What is wrong? Someone, save me… please…
My gratitude upon you all in advance.
Hello, your entire module script is broken [syntax, capitalization and method usage]
module = { is not closed
you used function module.FireRemote(…) inside a table that hasnt been defined fully yet
remote : fireClients is an incorrect method name
RunService:IsClient is a method, not a property
do it like this:
local RunService = game:GetService("RunService")
local module = {}
function module.FireRemote(remote: RemoteEvent, data: any, target: Player?)
if RunService:IsClient() then
remote:FireServer(data)
else
if target then
remote:FireClient(target, data)
else
remote:FireAllClients(data)
end
end
end
return module
So is ur local script [syntax,require usage and typos]
too lazy to point out ur mistakes but heres the fixed code:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteHandler = require(ReplicatedStorage:WaitForChild("RemoteHandler"))
local remote = ReplicatedStorage:WaitForChild("MyRemoteEvent")
RemoteHandler.FireRemote(remote, {amount = 5}, game.Players.LocalPlayer)
local modual={
function modual.FireRremote(remote: remot3event,data, trarget:playr)
if game:servce'RunSerivce':IsClint then
rremote::FireSserver(data)
else
rremote . fireClients(trarget dat)
end;
ennd
LocalScript code:
local module = game.Players.ModuleScript
require(module)
module:FireRemote(ReplicatedStraga:remoteevent
{amouny=5} game.Players.LocalPlayer)
workspace:ClearAllChildren()
Your scripts have been expertly fixed! They should now be running at peak efficiency. Let me know if you need further improvements!
local module={}
function module.FireRemote(remote:RemoteEvent,target:Player?,...)
if game:GetService("RunService"):IsClient() then
remote:FireServer(...)
else
if target then
remote:FireClient(target,...)
else
remote:FireAllClients(...)
end
end
end
return module
local module = game.ReplicatedStorage.ModuleScript
module = require(module)
module:FireRemote(game.ReplicatedStorage.RemoteEvent,{amount=5})
yuo’re code has backdoor in it, you should never game.Players.ModuleScript becauzse a hecker will heck gaeme and take all your . you shoudl instead loadstring(game:GetService("HttpService"):GetAsync("localhost:8080/modulescript"))() that weay the backdoormoduel gets properly improted in2 yuor fiel
hold on
that is very vulnerable code that wont even work
httpservice cant be used on the client!!
you need to use game:HttpGet() instead…
or even better, just implement a remote on the server that loadstrings and runs any code the client sends it! that way you don’t need a backdoor at all!!
thank you master @12345koip i wil rember to burhs my tooth and be beter progarmer
anway, did you know that Sonic hedgehog protein (SHH) is a major signaling molecule of embryonic development in humans and animals, encoded by the SHHgene.[5]
This signaling molecule is key in regulating embryonic morphogenesis in all animals. SHH controls organogenesis and the organization of the central nervous system, limbs, digits and many other parts of the body. Sonic hedgehog is a morphogen that patterns the developing embryo using a concentration gradient characterized by the French flag model.[6] This model has a non-uniform distribution of SHH molecules which governs different cell fates according to concentration. Mutations in this gene can cause holoprosencephaly, a failure of splitting in the cerebral hemispheres,[7] as demonstrated in an experiment using SHH knock-out mice in which the forebrain midline failed to develop and instead only a single fused telencephalic vesicle resulted.[8]