Recently, I’ve gotten back into figuring out Lua on Roblox, I’ve made a little bit of progress, however I’m aware that this fix is probably very easy, but I’m still a beginner with not much knowledge.
The idea is that there’s a door that when you click on a button, the door slowly starts to become transparent until it is fully open. I tried using a function for the click detection, and a for loop for the door transparency. However it doesn’t work and I tried a lot of things, even ditching the function and using an if else statement.
I do not request that you guys rescript this for me, I simply want to know the answer as to why this is happening. If you guys have any suggestions for how I can get better at Lua, please comment because I want to start taking this seriously. Thanks!
local door = game.Workspace.Model.Door.Transparency
par = script.Parent
function Clicked()
for i = 0.25, 0, 4 do
wait(1)
door = i
end
end
par.ClickDetector.MouseClick:connect(Clicked)