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

Script isn't working?

Asked by
rootx 15
11 years ago

I'm trying to make a time freeze script on roblox. However it doesn't exactly work the way I want it too.

I don't get an error or anything the keys just don't work :/

01<pre class="brush: lua">local Player = game.Players.LocalPlayer
02local Mouse = Player:GetMouse()
03local FreezeAll = true -- Freeze all?
04local admin = "Player1"
05 
06function anchorPartsSpecific(model)
07        for i, v in pairs(model:GetChildren()) do
08        if v:IsA"Model" and FreezeAll == false and v.Name == "FreezeMe!" then
09        anchorPartsSpecific(v)
10        elseif v:IsA"BasePart" then
11        v.Anchored = true
12        end
13    end
14end
15 
View all 48 lines...
0
What keys are you wanting to respond to? AxeOfMen 434 — 11y
0
Also, please describe what you expect to happen and what is actually happening. This will help others help you. AxeOfMen 434 — 11y

1 answer

Log in to vote
0
Answered by 11 years ago

Here is a quick example of how you can do it.

01local Parts = {}
02function Scan(name)
03 for I, v in pairs(name:GetChildren()) do
04  table.insert(Parts, v)
05  If #v:GetChildren() > 0 then
06  Scan(v)
07 end
08end
09end
10Scan(Workspace)
11for I, v in pairs(Parts) do
12 If v:IsA("Part") then
13 v.Anchored = true
14 end
15end
0
Btw this was done on iPad sorry for simple mistakes DragonSkyye 517 — 11y
Ad

Answer this question