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

How can I modify Properties of the Parts of a Model by Scripting?

Asked by 3 years ago
Edited 3 years ago

Are you alright, scripters? I was working in an Area 51-styled game where I want to optimize the FPS of the game by constantly deleting rooms any player are not in. I've tried to divide each room in Models (group) and I have tried to make a Script (in Command Bar) to trying it, but didn't succes. My original script is this (in Command Bar):

for i, part in pairs game.Workspace.RailGroup:GetChildren() do if part:IsA("BasePart") then Transparency = 1 end end

It did not worked.

(the Model I am working with right now is "RailGroup", and its parts, "Rail" or "Rail1").

I know it may be a basic function about Scripting in Roblox, but seriously I would be grateful if you, Scripters, correct me, please.

My best wishes and have a nice day, Scripters. =)

0
Setting the transparency isn't going to effectively "delete" the room, nor will it prevent ROBLOX from calculating its physics. Your syntax is malformed in the program you're trying to execute within the command-line; executing code there will only make adjustments in Studio, and when executed manually of course. Ziffixture 6913 — 3y
0
If you're not aware of that, I suggest you move this code appropriately into a proper Script Instance. Ziffixture 6913 — 3y
0
As for your code: https://pastebin.com/2TFBULxb. Ziffixture 6913 — 3y

Answer this question