Task.delay would probably work well. You cant stop exploiters from exploiting, but you can set things up in a way so that them exploiting changes nothing. If remove you remove the remote and use task.delay, exploiters wont be able to do anything
Instead of asking the client what the property is, you can calculate what the property should be based off of the start time and current time. This would allow you to remove the GetProperty remoteFunction
They can use dex explorer or other methods to find your remotes. They can also view remote traffic and find your remotes through that. Currently due to byfron exploiting is much less widespread so I wouldn’t worry too much, but making things secure is always good practice.
They could send anything, even malformed strings/numbers. You can do checks on the server but I think the best course of action would just be to remove the remote and find the property with information on the server.
you can calculate what the property should be based off of the start time and current time
function LocalTween:GetCurrentProperty(Property:string)
assert(getmetatable(self) == LocalTween, ErrorNotInstance:format("Play()", "LocalTween.new()"))
--return GetProperty:InvokeClient(game:GetService("Players"):GetPlayers()[1], self.InstanceToTween, Property)
if typeof(self.InstanceToTween) == "Instance" and typeof(Property) == "string" then
return self.Goal[Property] / (self.CurrentTime / self.CurrentTweenInfo.Time)
end
end
function LocalTween:Play()
assert(getmetatable(self) == LocalTween, ErrorNotInstance:format("Play()", "LocalTween.new()"))
TweenRemote:FireAllClients(self.CurrentTweenInfo, self.InstanceToTween, self.Goal, self.Remote)
task.spawn(function()
local TimeVal = 0
while TimeVal < self.CurrentTime do
TimeVal += task.wait()
end
end)
end
I would just get the starting time once and then just calculate the delta when you want to find the property.
I think your formula to find the current property is incorrect unless your goal is relative and the easing is linear.
this is the first time i started using coroutines and i was hoping they’d get garbage collected once i kill them and dereference them
The localtween model has been updated
and this is the extent of the server lag in my game by the way
I’ve also been getting an error called “Cannot close normal coroutine” when trying to destroy the thread which i don’t know why it’s happening and i can’t really get around it.