You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I wan to pass a function through a remote event’s “FireClient()” -
What is the issue? Include screenshots / videos if possible!
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I googled some stuff but they didn’t work, or fit with my situation.
My code:
--//VARIABLES\\--
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Assets = ReplicatedStorage.Assets
local Debris = game:GetService("Debris")
local Animations = Assets.Animations
local Events = Assets.Events
--//FUNCTIONS\\--
function Destroy(object : Instance)
Debris:AddItem(object, 0)
end
function callback()
local lighting = game.Lighting:GetChildren()
for i, lightEffect in pairs(lighting) do
lightEffect.Parent = ReplicatedStorage.Assets["Disabled Lighting FX"]
end
end
-- basically some random guy will be teleported to a "place".
-- places in my game are basically maps separated and placed far away from the map.
-- when some stuff happens a random player can be teleported to a place
Events.StartPlaceFunctions.Event:Connect(function(place : Instance, player : Player)
if place == script.Parent then
local character = player.Character
local hrp : Part = character:FindFirstChild("HumanoidRootPart")
hrp.CFrame = script.Parent.PrimaryPart.CFrame
Events.StartPlaceFunctionsToClient:InvokeClient(callback)
end
end)