Hello, I am making a disappearing staircase and I am using a modulescript for the settings. But for some reason it is very slow. It is supposed to be 1 second long but it is much longer.
My settings:
local ServerStorage = game:GetService("ServerStorage")
local stairSettings = require(ServerStorage.Settings)
local part = script.Parent
local i2 = stairSettings.i2
local TpC = stairSettings.transparencyChange
local waitTime = stairSettings.waitTime
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
--Disappear Effect
for i = 1, stairSettings.i2 do
part.Transparency += TpC
wait(i2/(i2 - 1))
end
--Collision and Reset
part.CanCollide = false
wait(waitTime)
part.CanCollide = true
part.Transparency = 0
end
end)
if you divide something by itself, it will always lead to 1. Dividing i2 by 99 would lead to just above a one-second wait. Also, the for loop repeats 100 times since i2 is 100. Meaning, that this would be a 100-second wait, and that’s before adding the three seconds for it to reappear.