I’m trying to make a horror game based in a school, and I’m having some problems with the doors.
Basically, I’m trying to make a sliding door for the game (using tweening) and whenever i open the door, random parts appear (this just started happening not too long ago) for a while it worked fine.
I’ve tried looking on the dev forum, and I can’t find anything about what’s happening to me. I’ve even asked some of my dev friends (one is a scripter for car crushers 2) but they’re all offline, and I’m very impatient.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
This is the script:
local runServ = game:GetService("RunService")
local tween = function(t, alpha)
return math.pow(t, alpha)/(math.pow(t, alpha) + math.pow(1-t, alpha))
end
local active = false
local open = false
local model = script.Parent.Parent
script.Parent.ClickDetector.MouseClick:Connect(function()
local frame = model.PrimaryPart.CFrame
if active then return end
active = true
if not open then
for i = 1, 80, 1 do
local t = i/80
model:SetPrimaryPartCFrame(frame:lerp(frame*CFrame.new(-3,0,0),tween(t,2)))
runServ.Heartbeat:Wait()
end
open = true
else
for i = 1, 80, 1 do
local t = i/80
model:SetPrimaryPartCFrame(frame:lerp(frame*CFrame.new(3,0,0),tween(t,2)))
runServ.Heartbeat:Wait()
end
open = false
end
active = false
end)
script.Parent.ClickDetector.CursorIcon = "rbxassetid://6168564135" <<< IRRELEVANT CUSTOM CURSOR THINGY
Please reply if you need any further information.