Ok so. Im making effects and i need run them on client by server.
how i can do it.
im trying use remote event for it but getting error
--CODE
local function huh()
print("huhuhuhuh")
end
wait(2)
game.ReplicatedStorage.RemoteEvent:FireAllClients(huh)
--ERROR
22:36:49.569 - Workspace.ki2005rill.LocalScript:2: attempt to call a nil value
22:36:49.569 - Stack Begin
22:36:49.570 - Script 'Workspace.ki2005rill.LocalScript', Line 2
22:36:49.570 - Stack End
No, I think this person is trying to run code on the client not run it on the server, like sending code through a remoteevent, maybe like something incommand does?
Like this.
Ok listen up all.
I have effects on server, since server its bad place for effects i need run them on client, but i wont 2441141 lines of code, thats why im creating function on server.
btw effects
This is not possible, and quite frankly is full of potential for hackers. If a hacker wanted to run a function of whatever they want, they could do lots of things since they now have access to run functions on the server. Again, this is not possible, and probably isn’t necessary.
sigh. ok listen. im creating effect on server. (hackers cant edit script source. right?)
so hackers cant do anything.
EDIT: In other words
--SERVER
local function huh()
print("huhuhuhuh")
end
wait(2)
game.ReplicatedStorage.RemoteEvent:FireAllClients(huh)
--LOCAL
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(func)
func()
end)
No, it’s not possible to send functions by :FireAllClients, only values (such as plr, in which will transfer the player to the localscript that’s OnClientEvent).
This isn’t possible, you can’t send a function through a RemoteEvent.
You could send the text of the function and then call loadstring() on the client, but you can’t because loadstring() was removed from the client. To get around this you would need to use something called LBI (Lua Bytecode Interpreter) to run the code instead.