Hello! Today, as I was coding my stuff I wanted to animate some objects (I mean alot by some) and I thought to use the client, so server lags less, here is my code
--server side
local storage = game:GetService("ReplicatedStorage")
local animClient = storage:WaitForChild("AnimateClient")
local animServer = storage:WaitForChild("AnimateServer")
animServer.OnServerEvent:Connect(function(_, instance, options)
animClient:FireAllClients(instance, options)
end)
--client side
local storage = game:GetService("ReplicatedStorage")
local animClient = storage:WaitForChild("AnimateClient")
local T = game:GetService("TweenService")
local TInfo = TweenInfo.new(0.6, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
animClient.OnClientEvent:Connect(function(instance, options)
for i,v in pairs(options) do
if i ~= "shouldTween" then
instance[i] = v
else
local t = T:Create(instance, TInfo, {Size = v})
t:Play()
end
end
end)
And it’s really not secure, an exploiter could just fire the event with any instance and it would get animated, any tips on securing this would be welcome!