How do I work around this bug?

I’ve recently encountered a bug for tweens which makes the tween ONLY work on the server.
I want the tween to work on all clients, but I don’t want to make a client script as it’s too easy to exploit and other issues.
I know it probably involves remote events, but I jus t can’t seem to find a work around
How would I find a solution to this bug and work around it?

I want to make the script work for the entire server including the clients but make it secure.
If you want more information, here are the scripts:

Rotation script
 local tweengoal = {
Orientation = Vector3.new(0,360,0)
}
local tweenservice = game:GetService(“TweenService”)
local part = script.Parent
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out, -1, false, 0)
local tween = tweenservice:Create(part,tweeninfo,tweengoal)
tween:Play()
Movement script
local tweenservice = game:GetService(“TweenService”)
local tweeninfo
local part = script.Parent
while true do
task.wait(.5)
print(“done”)
position = script.Parent.Position
goal1 = {
Position = position + Vector3.new(0,0,50)
}
goal2 = {
Position = position + Vector3.new(-50,0,0)
}
goal3 = {
Position = position + Vector3.new(50,0,0)
}
goal4 = {
Position = position + Vector3.new(0,0,-50)
}
local random = math.random(1,4)
tweeninfo = TweenInfo.new(.5,Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
if random == 1 then
tween = tweenservice:Create(part, tweeninfo, goal1)
elseif random == 2 then
tween = tweenservice:Create(part, tweeninfo, goal2)
elseif random == 3 then
tween = tweenservice:Create(part, tweeninfo, goal3)
elseif random == 4 then
tween = tweenservice:Create(part, tweeninfo, goal4)
end
tween:Play()
end

Works on the server but not the clients

1 Like

Are you trying to replicate to all clients or just one?

i think he means that the server does not replicate the tween to the clients

could you provide more information like are the scripts joined or is it two scripts. are they LocalScripts or just Scripts?
Does it happen on the server and not the client?
Does the console print any errors?

2 Likes

The output does not print any errors
The scripts are serverscripts
It does ONLY happen on the server and not the client
Sorry for the late reply

1 Like

Can you send the place file over? I think your code looks fine.

Wish I could, just this morning my account on Roblox got compromised and I’m trying to get it back
But when I tested it in another place, the same issue happened.
How would I work around it?

Depends on what you’re doing.

If you’re doing,
[server]
tween (object): position → newPosition

then it should just work, even if it’s laggy.

If you want a smooth transition from pointA to pointB you’re actually better off tweening from the client, like such:
[server]
fire allClients, FireTween(object, newPosition)

[cllient]
onServer FireTween(object, newPosition) → tween(object, newPosition)

I’m just a bit paranoid that this

can be exploited

Maybe. I personally never use tweens anyways. I just do

[server]
set location

[client]
set position to server location, with a certain speed

Considering there’s no way for me to tween it without there being a problem, what other way can I use?

Also unrelated, I got my account back

Wow, all I had to do was put the scripts in a different part
I guess that specific part was bugged or something?

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