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

Script works pretty well in Studio, but breaks when I play as a normal game. What's the problem?

Asked by 3 years ago
Edited 3 years ago

Hello. So I'm working on a door script, it works pretty well in Studio, it works in normal game too, but broken. I better explain it with GIFs:

Roblox Studio: https://imgur.com/ahDQ7vr Actual game: https://imgur.com/9YPjYCa

I can't figure out what's the issue. The script works pretty well without any errors, as it should be. I guess it's an engine bug, I don't know if there's a sollution of that issue. Here's the script:

01function onClick()
02script.Parent.ClickDetector.MaxActivationDistance=0
03if script.Parent.Parent.isOpen.Value==false then
04        script.Parent.DoorOpen:Play()
05        script.Parent.ClickDetector.MaxActivationDistance=0
06for i = 1,40 do
07        script.Parent.Parent:SetPrimaryPartCFrame(script.Parent.Parent.PrimaryPart.CFrame * CFrame.fromOrientation(0, -.05, 0))
08        wait()
09end
10script.Parent.Parent.isOpen.Value=true
11wait(1)
12script.Parent.ClickDetector.MaxActivationDistance=10
13    else
14script.Parent.ClickDetector.MaxActivationDistance=0
15script.Parent.DoorClose.Script.Disabled=false
View all 25 lines...

1 answer

Log in to vote
0
Answered by 3 years ago

try setting a max torque in the hinge and make the door anchored and un anchored when someone clicks it

0
Didn't work, unfortunately. But thanks for the helping anyway. Va1t_Dev 86 — 3y
Ad

Answer this question