#how to let this door system work?
1 messages · Page 1 of 1 (latest)
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)```
can you explain it better
i dont get it
see. now there is a door. this door only opens for (specific roblox group) only the group members can open it
@upper osprey
debug it first
@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
wdym
yh. the door doesnt change the angle. put the sounds works aswell
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?
do i have to anchor it? i have everything anchored in the game
no
If the door is anchored the physics constraint won't be able to move the door open
but when its unanchored the door fall down
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
why are you using motor 6 then
tbh my friend was working on the door. i copied it to learn
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
check dm
** You are now Level 2! **