Flashlight Replication

Hello.
So I am making a flashlight for my game. The way I did it is quite simple. I have a little part with a light source in ReplicatedStorage. Everytime the player presses the keybind for the flashlight, I clone the part and put it in the player’s head. With a RenderStepped event I keep it on the player’s head and point the part to the mouse. This work perfectly on client, but I don’t know how to replicate it on the Server. I can’t just make an event since that would use a lot of performance.
Any ideas ?

1 Like

You should firstly create the light on the server side and parent it into the player, then:

send argument from client → receive the argument on server → depending on the argmuent On or Off light

Small scheme in code for remotes
remote:FireServer(arguments) → remote:OnServerEvent:Connect(function(arguments) and on and off here.

If you cant figure it out lmk, I might help with a bit of code.

1 Like

Figured it out? Cuz im tryna get solution :smiley:, if not let me know at what u struggling

Sorry for the late reply. I figured it out. Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.