Script isn't working?
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 |
02 | local Mouse = Player:GetMouse() |
04 | local admin = "Player1" |
06 | function 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 |
16 | function anchorAll(model) |
17 | for i, v in pairs (model:GetChildren()) do |
18 | if v:IsA "Model" and FreezeAll = = true then |
20 | elseif v:IsA "BasePart" then |
22 | elseif v.Name = = admin then |
28 | function unanchorParts(model) |
29 | for i, v in pairs (model:GetChildren()) do |
32 | elseif v:IsA "BasePart" then |
38 | Mouse.KeyDown:connect( function (key) |
39 | if key:byte() = = 29 then |
40 | elseif FreezeAll = = true then |
42 | elseif FreezeAll = = false then |
43 | anchorPartsSpecific(workspace) |
44 | elseif key:byte() = = 30 then |
45 | unanchorParts(workspace) |