Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a Block Change Transparency in Spleef?

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

2 comments

0

You could always do " game.Workspace.SpleefP.Transparency = i / 10 "

0

?????

1 answer

✓ Accepted answer

"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)

This discussion is preserved as it was. New answers, comments, and votes are closed.