-
Notifications
You must be signed in to change notification settings - Fork 0
/
NoJump.lua
81 lines (72 loc) · 2.03 KB
/
NoJump.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
local settings = nil
local module = game.ServerStorage:WaitForChild("Settings", 5)
if not module then
warn("Please update the NoJump Loader. Simply re-insert the model.")
settings = require(script.Settings)
else
settings = require(game.ServerStorage:WaitForChild("Settings"))
if settings.ControllerSeatName == nil then
warn("Please update the NoJump Loader. Simply re-insert the model.")
settings = require(script.Settings)
end
end
if settings.Seatbelts then
script.NoJump.Seatbelts.Value = true
end
script.NoJump.ControllerSeatName.Value = settings.ControllerSeatName
script.NoJump.ExceptionSeatName.Value = settings.ExceptionSeatName
function findParentModel(object)
--if object.Parent == workspace or object.Parent.Parent == game.InsertService.Folder then
if object.Parent == workspace then
if not object:FindFirstChild("NoJump") then
local clone = script.NoJump:Clone()
clone.Parent = object
---
clone.Components.SeatType.Components.Value = clone.Components
---
clone.Disabled = false
end
else
findParentModel(object.Parent)
end
end
function setup(object)
if object:IsA("Seat") or object:IsA("VehicleSeat") then
findParentModel(object)
elseif object:IsA("Model") then
for i,v in pairs(object:GetChildren()) do
setup(v)
end
end
end
if settings.LocalModels then
setup(workspace)
end
if settings.InsertedModels then
-- Temporary Fix
workspace.ChildAdded:connect(function(model)
setup(model)
end)
--[[
game.InsertService.Folder.ChildAdded:connect(function(model)
setup(model)
end)
]]--
end
if settings.AllowAdmins then
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
wait()
for _,admin in pairs(settings.Admins) do
if player.Name == admin or player.UserId == game.CreatorId then
script.NoJumpControlPanel:Clone().Parent = player:WaitForChild("PlayerGui")
end
end
end)
end)
end
----------------------------
local event = Instance.new("RemoteEvent")
event.Name = "NoResetRE"
event.Parent = game.ReplicatedStorage
----------------------------