Remotes and Functions


-----serverscript
game:GetService("ReplicatedStorage").Remotes.effectremote.OnServerEvent:Connect(function(player)
	local function uhh()
		--code
	end
	
	local function uhh2()
		--code
	end
end)
---local script

effectremote:FireServer(whichever function from the server script)

Is there any way to do something like this? I don’t like having a remote that has like 400 different variables

I assume you want to pass functions to the server? And yes, that is possible (however, I would rather have the functions on the server due to exploiters, unless you’re able to verify it via the client.)

nono, The functions are being fired from the client. The functions are on the server script
i want to use them in the local

Then you need to add a FireClient() inside your OnServerEvent event.
Theory:
Client > Server > Client

I think i didn’t explain it too well.

I have a damage remote. I fire the damage remote in my local script like this

		damageremote:FireServer(rleg, rleg.CFrame * CFrame.new(0, -1, 0) * CFrame.new(math.random(-0.25, 0.25), math.random(-0.25, 0.25), math.random(-0.25, 0.25)) ,5.5, 7.7, 0.5, 0.25, hrp.CFrame.lookVector * 10,"rbxassetid://281156569",.8,1,false)

I’m trying to do that but without all of this (rleg, rleg.CFrame * CFrame.new(0, -1, 0) * CFrame.new(math.random(-0.25, 0.25), math.random(-0.25, 0.25), math.random(-0.25, 0.25)) ,5.5, 7.7, 0.5, 0.25, hrp.CFrame.lookVector * 10,“rbxassetid://281156569”,.8,1,false)

Without it, it wouldn’t really work, no?
You can shorten it down if anything.

HASDFHFL:LFSFJALF

ok look

-----serverscript
game:GetService("ReplicatedStorage").Remotes.effectremote.OnServerEvent:Connect(function(player)
	local function uhh()
		--code
	end
	
	local function uhh2()
		--code
	end
end)
---local script

effectremote:FireServer(   uhh()   )

effectremote:FireServer(   uhh2()   )

You can’t really access the functions on the client-side if you’re doing it that way.
What you can do is making it a module.

ok. What my script does is put i decal on the enemy player, how would i do that?

Decal where? Elaborate a bit more

It puts a decal on their leg. I’ll work on it my own for a little bit then come back if i need help

That sounds easy enough, you should be able to just insert a decal into it.
Alright.

Can you make a remote event for each function?