|
| 17 Jul 2017 08:30 AM |
So, i have this sliding door script with a handle, when you touch the handle [the handle is called "Interactive"] the door slides, it works and all, but the door sliding animation thing is TOO slow!!
This is my script.
local ClickerModule = re##################local clickEvent = ClickerModule.RemoteEvent local interactiveParts = {}##local activationDistance = 11 local doorOpen = false local changingState = false local sound = script.Parent.Glass.Sound
for i, v in pairs(script.Parent:GetChildren()) do if v.Name == "Interactive" then table.insert(interactiveParts, v) end end
local function distanceToCharacter(player, part) local character = player.Character if character then local torso = character:FindFirstChild("Torso") if torso then return((torso.Position - part.Position).magnitude) end end return math.huge end
clickEvent.OnServerEvent:connect(function(player, part) local isPart = false for i = 1, #interactiveParts do if part == interactiveParts[i] then isPart = true end end if isPart and player.Character and distanceToCharacter(player, part) <= activationDistance then if doorOpen == true and changingState == false then changingState = true sound.TimePosition = 3 sound:Play() for i = 1, 30 do script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame * CFrame.new(0.20, 0, 0)) end sound:Stop() changingState = false doorOpen = false elseif changingState == false then changingState = true sound.TimePosition = 0.1 sound:Play() for i = 1, 30 do script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame * CFrame.new(-0.20, 0, 0)) end sound:Stop() changingState = false doorOpen = true end end end)
-- I took out the "wait ()" bit and now it just doesn't slide at all. please help. |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2017 08:31 AM |
local ClickerModule = require(343254562)***
|
|
|
| Report Abuse |
|
|
Thezi
|
  |
| Joined: 23 May 2014 |
| Total Posts: 253 |
|
|
| 17 Jul 2017 08:36 AM |
| instead of .2 try .5 of something |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2017 09:49 AM |
if you wrote it you should literally know how to fix this simple problem because you should know where the movement part is
#code print("oh no an errorz!") |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2017 10:15 AM |
| If I knew, I wouldn't have posted it. Genius. -_- |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2017 07:06 PM |
make your own scripts?
#code print("oh no an errorz!") |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2017 07:18 PM |
| If ya want you can take my doors and use them, I don't really care. |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2017 07:27 PM |
in the for loop that moves the primarypart make it move x by something more (like -.5 or -.7)
and if you dont understand what i said then make your own scripts
|
|
|
| Report Abuse |
|
|