Krelinos
|
  |
| Joined: 09 Jan 2010 |
| Total Posts: 425 |
|
|
| 24 Jan 2013 09:18 PM |
if percent < 0.75 then part.BackSurface = "Studs" part.BottomSurface = "Studs" part.FrontSurface = "Studs" part.LeftSurface = "Studs" part.RightSurface = "Studs" part.TopSurface = "Studs" end
I want to shorten the surface changing lines, how would I do that? |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2013 09:20 PM |
Make the brick smaller?
Fail: http://www.roblox.com/qwe543fdhg45y-item?id=24975956 |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2013 09:21 PM |
| If you are doing this often throughout a script i would just make a function for it... |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Jan 2013 09:23 PM |
| You really shouldn't worry about making properties more efficient when you assign them |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2013 09:23 PM |
God, I'm stupid. Anyway, yeah I would use a function.
Fail: http://www.roblox.com/qwe543fdhg45y-item?id=24975956 |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2013 09:23 PM |
if percent < 0.75 then _G.SetSurfaces(part,"studs")
end
_G.SetSurfaces(thing,what) thing.BackSurface = what thing.BottomSurface = what thing.FrontSurface = what thing.LeftSurface = what thing.RightSurface = what thing.TopSurface = what end
|
|
|
| Report Abuse |
|
|
Krelinos
|
  |
| Joined: 09 Jan 2010 |
| Total Posts: 425 |
|
|
| 24 Jan 2013 09:24 PM |
| No. I want to change it so instead of changing each surface one by one, it will only need one line for each surface(for loop?). |
|
|
| Report Abuse |
|
|
| |
|
Krelinos
|
  |
| Joined: 09 Jan 2010 |
| Total Posts: 425 |
|
|
| 24 Jan 2013 09:25 PM |
Oh man, that's a lot of replies before that last one came out.
Alright, I'll do a function. Thanks. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2013 09:46 PM |
local p = {"Back","Bottom","Front","Left","Right","Top"} if percent < 0.75 then for i,v in pairs(p) do loadstring("part."..v.."=Enum.SurfaceType.Studs") end end
ha, shorter, yet less efficient c:
|
|
|
| Report Abuse |
|
|