#how to let this door system work?

1 messages · Page 1 of 1 (latest)

dark kite
#

its a group door. if local player is in the group. he can open the door. if hes not. he cant. i am a group member. and when i tried to open. everything worked as sounds and yh. but the door didnt open. didnt change the angle.

#

here is the code inside Door Script

#
local Cooldown2 = false

script.Parent.Clicc.ClickDetector.MouseClick:Connect(function(d)
    if script.Parent.lock.Value or not d:IsInGroup(script.Parent.GroupId.Value) then script.Parent.door["Locked Door"]:Play() return end
    if Cooldown then return end
    Cooldown = true
    d.Character.Humanoid:LoadAnimation(script.Animation):Play()    
    script.Parent.door.Open:Play()
    script.Parent.Motor.Motor.DesiredAngle = -1.7
    wait(2)
    script.Parent.Motor.Motor.DesiredAngle = 0
    wait(.5)
    script.Parent.door.Close:Play()
    Cooldown = false
end)

script.Parent.Clicc.ClickDetector.RightMouseClick:Connect(function(player)
    if not player.PlayerGui:FindFirstChild("DoorAction") then
        local gui = script.DoorAction:Clone()
        gui.Parent = player.PlayerGui
        gui.Value.Value = script.Parent
        gui.Script.Disabled = false
    end
end)```
upper osprey
#

i dont get it

dark kite
#

@upper osprey

hollow holly
#

@dark kite Any errors?

#

Also, use better variable names. d is not helpful for the reader, it makes your code harder to understand

#

player would be a better name in this situtation

dark kite
dark kite
hollow holly
#

Is anything anchored? Any friction anywhere?

#

Is the angle of the motor changing?

#

And are you sure desired angle is in radians and not degrees?

dark kite
#

do i have to anchor it? i have everything anchored in the game

dark kite
hollow holly
dark kite
#

but when its unanchored the door fall down

hollow holly
#

Then you didn't set up the joint correctly

#

The hinge should hold it in place

dark kite
#

alr. the hinge needs to be anchored right?

#

no wait. i dont want physics. i want when the player click on teh door. it opens but not smooth. just like it teleports yk

bright gust
#

why are you using motor 6 then

dark kite
#

tbh my friend was working on the door. i copied it to learn

bright gust
#

you can instead weld the door to the hinge, keep the hinge anchored, save the close rotation and open rotation and change it like that

#

is this just a door or a double door

dark kite
#

just a door

#

so

bright gust
#

check dm

rain prismBOT
#

studio** You are now Level 2! **studio