-- Decompiled with the Synapse X Luau decompiler.


local v1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
while not v1.Loaded do
	game:GetService("RunService").Heartbeat:Wait();
end;
local l__StarterPlayer__2 = v1.StarterPlayer;
local l__CollectionService__3 = v1.CollectionService;
local l__Hoverboards__1 = v1.Directory.Hoverboards;
local u2 = nil;
function Create(p1)
	local l____HOVERBOARD__4 = v1.PlayerModule.Get("Character", p1):FindFirstChild("__HOVERBOARD");
	if l____HOVERBOARD__4 then
		l____HOVERBOARD__4:Destroy();
	end;
	local v5 = v1.StatService.Get(p1);
	if v5 then
		if not v5.Hoverboard then
			return;
		end;
	else
		return;
	end;
	local v6 = l__Hoverboards__1[v5.Hoverboard];
	if not v6 then
		return;
	end;
	local v7 = v1.PlayerModule.Get("Humanoid");
	local v8 = v1.PlayerModule.Get("RootPart");
	if v7 then
		if v8 then
			u2 = v7.HipHeight;
			v8.CFrame = v8.CFrame + Vector3.new(0, v7.HipHeight - v6.HipHeight, 0);
			v7.HipHeight = v6.HipHeight;
			v7.AutoJumpEnabled = false;
		end;
	end;
end;
local l__LocalPlayer__3 = v1.LocalPlayer;
function Remove(p2)
	local v9 = v1.PlayerModule.Get("Humanoid");
	local v10 = v1.PlayerModule.Get("RootPart");
	if v9 then
		if v10 then
			if p2 == l__LocalPlayer__3 then
				v10.Velocity = Vector3.new();
			end;
			if u2 then
				v9.HipHeight = u2;
				u2 = nil;
			end;
			v9.AutoJumpEnabled = true;
		end;
	end;
end;
function UpdatePlayer(p3, p4)
	local v11 = v1.PlayerModule.Get("Character", p3);
	if p4 then
		if not v11:FindFirstChild("__HOVERBOARD") then
			return Create(p3);
		end;
	end;
	if not p4 then
		if v11:FindFirstChild("__HOVERBOARD") then
			Remove(p3);
		end;
	end;
end;
function Toggle()
	v1.Variables.UsingHoverboard = not v1.Variables.UsingHoverboard;
	if not v1.Variables.UsingHoverboard then
		Remove(l__LocalPlayer__3);
	else
		Create(l__LocalPlayer__3);
	end;
	v1.Network.Fire("Update Hoverboard State", v1.Variables.UsingHoverboard);
end;
l__CollectionService__3:GetInstanceAddedSignal("UsingHoverboard"):Connect(function(p5)
	UpdatePlayer(p5, true);
end);
l__CollectionService__3:GetInstanceRemovedSignal("UsingHoverboard"):Connect(function(p6)
	UpdatePlayer(p6, false);
end);
task.defer(function()
	while v1.Variables.LoadingWorld do
		v1.Heartbeat();	
	end;

		for v12, v13 in ipairs((l__CollectionService__3:GetTagged("UsingHoverboard"))) do
		if not v12 then
			break;
		end;
		coroutine.wrap(UpdatePlayer)(v13, true);	
	end;
end);
v1.Signal.Fired("Stat Changed"):Connect(function(p7)

end);
v1.Signal.Fired("Changed Platform"):Connect(function()

end);
v1.Signal.Fired("World Changed"):Connect(function()
	if v1.Variables.UsingHoverboard then
		Toggle();
	end;
end);
