Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

Have an issue regarding rotation when switched to FE?

Asked by
Kryptio 19
7 years ago
Edited 7 years ago

Ok I had this code to where it would rotate like a realistic door on Server Scripts, but when i put it into a Local Script it rotates instantly and not as good as it did in the Server Script. And no i cant keep this in the ServerScript as it wont work when a Client touches the door.

What can i do to make this rotate nice again?

Increment = -96
debounce = false

function rotate(model, amount)
        for i=1, math.abs(amount/1) do
            model:SetPrimaryPartCFrame(model.Parent.Hinge.CFrame * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0))
            wait()
        end 
end
0
Touches the door? You can set it on the Server and have a Touched event, or does that go against what you're trying to do? Shawnyg 4330 — 7y
0
well the way im trying to do it does go against it, bec then it wont afftect the client (player) it would affect the server overall, and im trying to make it like an event like then when you step on a part that way its only one Client will see it at a time. Kryptio 19 — 7y
0
So basically i dont want anyone else to see this door open except the person who touched it, but i have that already going, the issue here is when you step on the door it does rotate, but its instant rather then the slow pace i originally had it when it was a server event. Hope that makes sense Kryptio 19 — 7y
0
I'm not sure why this would rotate at a different pace than on the server. The calculations are absolute. You could try keeping it a server script, then replicating the door to all clients(i.e placing in every Camera). Goulstem 8144 — 7y
View all comments (2 more)
0
Alternatively, you could have the Touched event fire on the server, then use Remotes to have it rotate on the client. But then this problem may just occur again. Goulstem 8144 — 7y
0
I actually just tried that before i looked on here lol and it does the same thing... Yea i dont know why its a much drastic change from really good slow pace to an instant, ive even tried changing the wait time but no change. Kryptio 19 — 7y

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago

You have a debounce value, but you don't use it. That's probably the issue.

Ad

Answer this question