Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a Block Change Transparency in Spleef?

Asked by 10 years ago

I am trying to make a script for spleef. The script is a regular script in the part in workspace. Here is the script. How do I make it so that the part (SpleefP) Will make the transparency stop at 0.9?

game.Workspace.SpleefP.Touched:connect(function(hit)
for i=1,9 do
           wait(0.1)
            game.Workspace.SpleefP.Transparency = game.Workspace.SpleefP.Transparency + 0.1
        end
    end)

SpleefP is the part name. I figured that since the transparency is set to 0 automatically then you would have to ADD 0.1

0
You could always do " game.Workspace.SpleefP.Transparency = i / 10 " VariadicFunction 335 — 10y
0
????? raystriker6707 30 — 10y

1 answer

Log in to vote
0
Answered by
Nymint 85
10 years ago

"i" Is the index, dude, it's maximum index is 9. so 9/10 = 0.9, Real basic math.

local Sp=Workspace.SpleefP local Debounce=false
Sp.Touched:connect(function(hit)
if Debounce==false then Debounce=true
for i=1,9 do wait(.1)
    Sp.Transparency=Sp.Transparency+i/10
        end Debounce=true end)
Ad

Answer this question