Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Create smoke for specified part (being destroyed)	


local function createSmoke(targetPart)
	local pos = Vector3.new(0, 0, 0)
	local size = 3
	if targetPart:IsA("Model") and targetPart.PrimaryPart then
		--local plate = targetPart:FindFirstChild("Plate", true)
		local plate = targetPart.PrimaryPart
		pos = plate.Position
		size = 1*plate.Size.X
	else
		pos = targetPart.Position
		size = 1*targetPart.Size.X
	end	
	
	local smokePart = Instance.new("Part")
	smokePart.Name = "SmokePart"
	smokePart.Transparency = 1
	smokePart.CanCollide = false
	smokePart.Anchored = true
	--smokePart.Position = getPositionRelativetoBase(smokePart, pos) + Vector3.new(0, 1, 0)
	smokePart.Position = pos + Vector3.new(0, 1, 0)
	smokePart.Size = Vector3.new(1, 1, 1)
	smokePart.Parent = mapManager.getMap()
	
	local smoke = Instance.new("Smoke")
	smoke.Parent = smokePart
	smoke.RiseVelocity = 0
	smoke.Size = size
	
	DebrisService:AddItem(smokePart, 0.75)
end
----- door -----



interactive.ClickDetector.MouseClick:Connect(function()
	if doorOpen and not changingState and not doorLocked then
		changingState = true
		for i = 1, 12 do
			script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(7), 0))
			wait()
		end
		changingState = false
		doorOpen = false
		lockInteractive.ClickDetector.MaxActivationDistance = 12
	elseif not changingState and not doorLocked then
		doorOpen = true
		changingState = true
		lockInteractive.ClickDetector.MaxActivationDistance = 0
		for i = 1, 12 do
			script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(-7), 0))
			wait()
		end
		changingState = false
	end
end)
-- << LOCAL FUNCTIONS >>


local function updateUIs()
	local frameSize = deviceFrameSizes["Computer"]
	if main.device == "Mobile" then
		if main.tablet then
			frameSize = deviceFrameSizes["Tablet"]
		else
			frameSize = deviceFrameSizes["Phone"]
		end
	end
	for frame, aspectRatio in pairs(framesToAdapt) do
		local currentFrameSize = frameSize
		if aspectRatio > 1 then
			currentFrameSize = frameSize/1.5
		end
		frame.Position = UDim2.new(0,0,(1-currentFrameSize)/2,0)
		frame.Size = UDim2.new(0,0,currentFrameSize,0)
		local absoluteX = frame.AbsoluteSize.Y * aspectRatio
		frame.Position = UDim2.new(0.5, -absoluteX/2, frame.Position.Y.Scale, frame.Position.Y.Offset)
		frame.Size = UDim2.new(0, absoluteX, frame.Size.Y.Scale, frame.Size.Y.Offset)
	end
end

local function screenChanged()
	screen_changing = screen_changing + 1
	wait(0.5)
	screen_changing = screen_changing - 1
	if screen_changing == 0 then
		-----------
		updateUIs()
		-----------
		main:GetModule("PageAbout"):CreateCredits()
	end
end
-- Allows SCP 049 to talk


local voicelines = {script.Parent.Hello, script.Parent.ICanSeeYouAreNotWell, script.Parent.ImNotTryingToHarmYou, script.Parent.OhMy, script.Parent.OhMy2, script.Parent.Song}
while wait(15) do
for i, voiceline in pairs(voicelines) do
	wait(15) 
		voiceline:Play()
	end
end
-- places a brick at pos and returns the position of the brick's opposite corner


function placeBrick(cf, pos, color)
	local brick = Instance.new("Part")
	brick.BrickColor = color
	brick.CFrame = cf * CFrame.new(pos + brick.Size / 2)
	script.Parent.BrickCleanup:Clone().Parent = brick -- attach cleanup script to this brick
	brick.BrickCleanup.Disabled = false
	brick.Parent = game.Workspace
	return brick, pos + brick.Size
end

function buildWall(cf)
	local color = BrickColor.random()
	local bricks = {}

	assert(wallWidth>0)
	local y = 0
	while y < wallHeight do
		local p
		local x = -wallWidth/2
		while x < wallWidth/2 do
			local brick
			brick, p = placeBrick(cf, Vector3.new(x, y, 0), color)
			x = p.x
			table.insert(bricks, brick)
			brick:MakeJoints()
			wait(brickSpeed)
		end
		y = p.y
	end

	return bricks
end


function snap(v)
	if math.abs(v.x)>math.abs(v.z) then
		if v.x>0 then
			return Vector3.new(1,0,0)
		else
			return Vector3.new(-1,0,0)
		end
	else
		if v.z>0 then
			return Vector3.new(0,0,1)
		else
			return Vector3.new(0,0,-1)
		end
	end
end


Tool.Enabled = true
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	local targetPos = humanoid.TargetPoint
	local lookAt = snap( (targetPos - character.Head.Position).unit )
	local cf = CFrame.new(targetPos, targetPos + lookAt)

	Tool.Handle.BuildSound:play()

	buildWall(cf)

	wait(5)

	Tool.Enabled = true
end

script.Parent.Activated:connect(onActivated)
--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]

--
local PlayerSpawning=false; --[[ Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position. ]]--
local AdvancedRespawnScript=script;
repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
local Killer=AdvancedRespawnScript.Parent;
if AdvancedRespawnScript and Killer and Killer:FindFirstChild("Thumbnail")then
Killer:FindFirstChild("Thumbnail"):Destroy();
end;
local GameDerbis=Game:GetService("Debris");
local KillerHumanoid;
for _,Child in pairs(Killer:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
KillerHumanoid=Child;
end;
end;
local Respawndant=Killer:Clone();
if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]--
coroutine.resume(coroutine.create(function()
if Killer and KillerHumanoid and KillerHumanoid:FindFirstChild("Status")and not KillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
SpawnModel=Instance.new("Model");
SpawnModel.Parent=KillerHumanoid.Status;
SpawnModel.Name="AvalibleSpawns";
else
SpawnModel=KillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
end;
function FindSpawn(SearchValue)
local PartsArchivable=SearchValue:GetChildren();
for AreaSearch=1,#PartsArchivable do
if PartsArchivable[AreaSearch].className=="SpawnLocation"then
local PositionValue=Instance.new("Vector3Value",SpawnModel);
PositionValue.Value=PartsArchivable[AreaSearch].Position;
PositionValue.Name=PartsArchivable[AreaSearch].Duration;
end;
FindSpawn(PartsArchivable[AreaSearch]);
end;
end;
FindSpawn(Game:GetService("Workspace"));
local SpawnChilden=SpawnModel:GetChildren();
if#SpawnChilden>0 then
local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
local RespawningForceField=Instance.new("ForceField");
RespawningForceField.Parent=Killer;
RespawningForceField.Name="SpawnForceField";
GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
Killer:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
else
if Killer:FindFirstChild("SpawnForceField")then
Killer:FindFirstChild("SpawnForceField"):Destroy();
end;
Killer:MoveTo(Vector3.new(0,115,0));
end;
end));
end;
function Respawn()
Wait(5);
Respawndant.Parent=Killer.Parent;
Respawndant:makeJoints();
Respawndant:FindFirstChild("Head"):MakeJoints();
Respawndant:FindFirstChild("LowerTorso"):MakeJoints();
Killer:remove();
end;
if AdvancedRespawnScript and Killer and KillerHumanoid then
KillerHumanoid.Died:connect(Respawn);
end;
--!no-shared
--!no-service



local ReplicatedStorage = game:GetService('ReplicatedStorage')
local RunService = game:GetService('RunService')

local IsStudio = RunService:IsStudio()

local Modules = ReplicatedStorage
	:WaitForChild('Modules', 30)
	:WaitForChild('Global', 30);
local ModuleWaitTime = IsStudio and 3 or 60

local meta = {}

function meta.__index(self, key)
	return function ()
		local Module = Modules:WaitForChild(key, ModuleWaitTime)

		if Module then
			local Source = require(Module)

			self[key] = function ()
				return Source
			end

			return Source
		end
	end
end

shared._Cache = {};
setmetatable(shared, meta);

return nil
--[[Transmission]]


	Tune.TransModes		= {"Auto","Semi"}												--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -1200		-- Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		-- Automatic downshift point (relative to peak RPM, positive = Under-rev)
	Tune.ShiftTime = .05				-- The time delay in which you initiate a shift and the car changes gear
	
	--Gear Ratios
	Tune.FinalDrive		= 3.1
	Tune.Ratios			= {
		--[[Reverse]]	4.29			,
		--[[Neutral]]	0			,
		--[[ 1 ]]		4.71			,
		--[[ 2 ]]		3.14		,
		--[[ 3 ]]		2.10		,
		--[[ 4 ]]		1.67		,
		--[[ 5 ]]		1.29		,
		--[[ 6 ]]		1.00			,
		--[[ 7 ]]		0.84			,
	}
	Tune.FDMult			= 1.00			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------




function onRunning(speed)
	if speed>0 then
		playAnimation("walk", 0.1, AnimController)
		pose = "Running"
	else
		playAnimation("idle", 0.1, AnimController)
		pose = "Standing"
	end
end

function onDied()
	pose = "Dead"
end

function onJumping()
	playAnimation("jump", 0.1, AnimController)
	jumpAnimTime = jumpAnimDuration
	pose = "Jumping"
end

function onClimbing()
	playAnimation("climb", 0.1, AnimController)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	if (jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, AnimController)
	end
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function onSwimming(speed)
	if speed>0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function getTool()	
	for _, kid in ipairs(Figure:GetChildren()) do
		if kid.className == "Tool" then return kid end
	end
	return nil
end

function getToolAnim(tool)
	for _, c in ipairs(tool:GetChildren()) do
		if c.Name == "toolanim" and c.className == "StringValue" then
			return c
		end
	end
	return nil
end

function animateTool()
	
	if (toolAnim == "None") then
		playToolAnimation("toolnone", toolTransitionTime, AnimController)
		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, AnimController)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, AnimController)
		return
	end
end

function moveSit()
	RightShoulder.MaxVelocity = 0.15
	LeftShoulder.MaxVelocity = 0.15
	RightShoulder:SetDesiredAngle(3.14 /2)
	LeftShoulder:SetDesiredAngle(-3.14 /2)
	RightHip:SetDesiredAngle(3.14 /2)
	LeftHip:SetDesiredAngle(-3.14 /2)
end

local lastTick = 0

function move(time)
	local amplitude = 1
	local frequency = 1
  	local deltaTime = time - lastTick
  	lastTick = time

	local climbFudge = 0
	local setAngles = false

  	if (jumpAnimTime > 0) then
  		jumpAnimTime = jumpAnimTime - deltaTime
  	end

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, AnimController)
	elseif (pose == "Seated") then
		stopAllAnimations()
		moveSit()
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.1, AnimController)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
--Rescripted by Luckymaxer



Character = script.Parent
Humanoid = Character:FindFirstChild("Humanoid")

Debris = game:GetService("Debris")

if Humanoid then
	Humanoid.WalkSpeed = (math.abs(Humanoid.WalkSpeed) * -1)
	wait(2.5)
	Humanoid.WalkSpeed = (math.abs(Humanoid.WalkSpeed) * 1)
end

Debris:AddItem(script, 0.5)
script:Destroy()
-- number macro item



local item = {}

local utilFolder = script.Parent.Parent.Util
local parametricEval = require(utilFolder.ParametricEval)


function item:New(itemContainer, macroItem, pluginSettings, updatePluginSettings)
	itemContainer.TextLabel.Text = macroItem.Text
	local fieldX, fieldY, fieldZ = itemContainer.Field.X, itemContainer.Field.Y, itemContainer.Field.Z
	
	local function updateDisplay()
		fieldX.Text = macroItem.Value.X
		fieldY.Text = macroItem.Value.Y
		fieldZ.Text = macroItem.Value.Z
	end
	
	local function valueSet(newValue)
		local oldValue = macroItem.Value
		macroItem.Value = newValue
		pluginSettings[macroItem.SettingId] = newValue
		updatePluginSettings()
		updateDisplay()
		if type(macroItem.Changed) == "function" then
			macroItem:Changed(newValue, oldValue)
		end
	end

	function macroItem:Set(value)
		valueSet(value)
	end
	
	function macroItem:UpdateText(text)
		itemContainer.TextLabel.Text = text
	end
	
	local function focusLost(enterPressed)
		if enterPressed then
			local x, y, z = parametricEval(fieldX.Text), parametricEval(fieldY.Text), parametricEval(fieldZ.Text)
			if x and y and z then
				valueSet(Vector3.new(x, y, z))
			else
				updateDisplay()
			end
		else
			updateDisplay()
		end
	end
	
	fieldX.FocusLost:Connect(focusLost)
	fieldY.FocusLost:Connect(focusLost)
	fieldZ.FocusLost:Connect(focusLost)
	updateDisplay()	
	
	
	--function macroItem:LoadSetting(storedSetting)
	--	macroItem.Value = Vector3.new(storedSetting[1], storedSetting[2], storedSetting[3])
	--end
	
	function macroItem:UpdateTheme(theme)
		itemContainer.TextLabel.TextColor3 = theme:GetColor(Enum.StudioStyleGuideColor.SubText)
		fieldX.TextColor3 = theme:GetColor(Enum.StudioStyleGuideColor.MainText)
		fieldX.BackgroundColor3 = theme:GetColor(Enum.StudioStyleGuideColor.InputFieldBackground)
		fieldY.TextColor3 = theme:GetColor(Enum.StudioStyleGuideColor.MainText)
		fieldY.BackgroundColor3 = theme:GetColor(Enum.StudioStyleGuideColor.InputFieldBackground)
		fieldZ.TextColor3 = theme:GetColor(Enum.StudioStyleGuideColor.MainText)
		fieldZ.BackgroundColor3 = theme:GetColor(Enum.StudioStyleGuideColor.InputFieldBackground)
	end
end

return item
-- functions for formatting spritesheet strings



local function wrapText(text, size, settings)
	local index = 1;
	local lines, words = {""}, getWords(text, true);
	local lineWidth, maxWidth = 0, abs(settings.child.AbsoluteSize.x);
	for i = 1, #words do
		local word = words[i];
		if (word ~= "\n") then
			local width = getStringWidth(word, settings.styles[settings.style][size]);
			if (width + lineWidth <= maxWidth) then
				lines[index] = lines[index] .. word;
			else
				lineWidth = 0;
				index = index + 1;
				lines[index] = word;
			end;
			lineWidth = lineWidth + width;
		else
			lineWidth = 0;
			index = index + 1;
			lines[index] = "";
		end;
	end;
	return lines;
end;

function scaleText(text, settings)
	local child = settings.child;
	local attached = settings.attached;

	sort(settings.information.sizes, function(a, b) return a > b; end);
	local bestSize = settings.information.sizes[1];
	local broke = false;
	
	for i = 1, #settings.information.sizes do
		local size = settings.information.sizes[i];
		local sizeSet = settings.styles[settings.style][size];
		local lines = child.TextWrapped and wrapText(text, size, settings) or getLines(text);
	
		local widths = {};
		local height = -sizeSet.firstAdjust;
		for j = 1, #lines do
			local line = lines[j];
			height = height + getMaxHeight(line, sizeSet)
			insert(widths, getStringWidth(line, sizeSet));
		end;
		
		local width = max(unpack(widths));
		if (width <= abs(child.AbsoluteSize.x) and height <= abs(child.AbsoluteSize.y)) then
			bestSize = size;
			broke = true;
			break;
		end;
	end;
	
	return broke and bestSize or settings.information.sizes[#settings.information.sizes];
end;
--// Handling Settings		


	Firerate = 60 / 350; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
	
	FireMode = 5; -- 5 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
--[[**
	ensures value matches string pattern

	@param string pattern to check against

	@returns A function that will return true iff the condition is passed
**--]]


function t.match(pattern)
	assert(t.string(pattern))
	return function(value)
		local stringSuccess, stringErrMsg = t.string(value)
		if not stringSuccess then
			return false, stringErrMsg
		end

		if string.match(value, pattern) == nil then
			return false, string.format("\"%s\" failed to match pattern \"%s\"", value, pattern)
		end

		return true
	end
end
-- (Hat Giver Script - Loaded.)



debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "Swordpack"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(0,-0.25,0) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0, 1.4, -0.8)
		h.AttachmentRight = Vector3.new(1, 0, 0)
		h.AttachmentUp = Vector3.new(0, 1, 0)
		h.AttachmentForward = Vector3.new(-0, -0, -1)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
--[[
	Creates a new GuiController. hideOtherGuis and showOtherGuis are optional
	callbacks that can be used to control hiding and showing of GUIs. If they
	are defined the GuiController will not do any GUI manipulation. It will
	instead call those callbacks and return.

	Parameters:
	screenGuis - An array of Roact.Refs of the ScreenGuis for this module
	hideOtherGuis - A callback that is called when hideGuis is called
	showOtherGuis - A callback that is called when showGuis is called
]]


function GuiController.new(screenGuis: { any }?, hideOtherGuis: Callback?, showOtherGuis: Callback?)
	local self = {
		StarterGui = StarterGui,
		UserInputService = UserInputService,
		player = Players.LocalPlayer,
		screenGuis = screenGuis or {},
		hideOtherGuis = hideOtherGuis,
		showOtherGuis = showOtherGuis,
		disabledGuis = {},
		disabledCoreGuis = {},
		modalEnabled = false,
	}

	return setmetatable(self, GuiController)
end
---------------------------------------------------



This = script.Parent
Lift = This.Parent.Parent.Parent
Elevator = This.Parent.Parent.Parent
CustomLabel = require(This.Parent.Parent.Parent.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Lift:WaitForChild("Floor").Changed:connect(function(floor)
  --custom indicator code--
  ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))		
	SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end



function SetDisplay(ID,CHAR)
	if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
 		for i,l in pairs(Characters[CHAR]) do 
			for r=1,16 do	
				This.Display["DIG"..ID]["D"..r].Transparency = (l:sub(r,r) == "1" and 0 or 1)
			end
		end
	end
end

while true do
	wait()
	if Elevator:WaitForChild("Direction").Value ~= 0 then 
		if Elevator:WaitForChild("Velocity").Value ~= 0 then
			if Elevator:WaitForChild("Direction").Value == 1 then
				This.Display.ARW1.UP.Transparency = 0
				This.Display.ARW1.MID.Transparency = 0
				This.Display.ARW1.DOWN.Transparency = 1
			else
				This.Display.ARW1.UP.Transparency = 1
				This.Display.ARW1.MID.Transparency = 0
				This.Display.ARW1.DOWN.Transparency = 0
			end
		elseif Elevator:WaitForChild("Velocity").Value == 0 then
			if Elevator:WaitForChild("Direction").Value == 1 then
				wait(0.5)
				This.Display.ARW1.UP.Transparency = 1
				This.Display.ARW1.MID.Transparency = 1
				This.Display.ARW1.DOWN.Transparency = 1
				wait(0.5)
				This.Display.ARW1.UP.Transparency = 0
				This.Display.ARW1.MID.Transparency = 0
				This.Display.ARW1.DOWN.Transparency = 1
			else
				wait(0.5)
				This.Display.ARW1.UP.Transparency = 1
				This.Display.ARW1.MID.Transparency = 1
				This.Display.ARW1.DOWN.Transparency = 1
				wait(0.5)
				This.Display.ARW1.UP.Transparency = 1
				This.Display.ARW1.MID.Transparency = 0
				This.Display.ARW1.DOWN.Transparency = 0
			end
		end
	else
		This.Display.ARW1.UP.Transparency = 1
		This.Display.ARW1.MID.Transparency = 1
		This.Display.ARW1.DOWN.Transparency = 1
	end
end
------------------------------------------------------------------------------------------------------------------


local Engine = script.Template:Clone()
Engine.Parent = GUI.Controls
Engine.Text = "ENGINE: "..Settings.EngineKey.Name

local Throttle = script.Template:Clone()
Throttle.Parent = GUI.Controls
Throttle.Text = "THROTTLE: "..Settings.ThrottleUp.Name.."/"..Settings.ThrottleDown.Name
Throttle.TextScaled = true

local Yaw = script.Template:Clone()
Yaw.Parent = GUI.Controls
Yaw.Text = "YAW: "..Settings.YawLeft.Name.."/"..Settings.YawRight.Name

local Roll = script.Template:Clone()
Roll.Parent = GUI.Controls
Roll.Text = "ROLL: "..Settings.RollLeft.Name.."/"..Settings.RollRight.Name

local Pitch = script.Template:Clone()
Pitch.Parent = GUI.Controls
Pitch.Text = "PITCH: "..Settings.PitchUp.Name.."/"..Settings.PitchDown.Name
--[[ http://coffeescript.org/ ]]

 --
local coffee = script.Parent;
local drinking = false

coffee.Equipped:connect(function()
	coffee.Handle.OpenSound:Play()
end)

coffee.Activated:connect(function()
	if drinking then
		return
	end

	drinking = true
	coffee.GripForward = Vector3.new(0,-1,0)
	coffee.GripPos = Vector3.new(1.5,.85,-.15)
	coffee.GripRight = Vector3.new(1,0,0)
	coffee.GripUp = Vector3.new(0,0,1)

	coffee.Handle.DrinkSound:Play()

	wait(1)
	
	coffee.Parent.Humanoid.Health = coffee.Parent.Humanoid.Health + 100
	restPos()

	drinking = false
end)

coffee.Unequipped:connect(function()
	restPos()
	coffee.Handle.DrinkSound:Stop()
	drinking = false
end)

function restPos()
	coffee.GripForward = Vector3.new(0,-1,0)
	coffee.GripPos = Vector3.new(0,0.15,-0.3)
	coffee.GripRight = Vector3.new(-1,0,0)
	coffee.GripUp = Vector3.new(0,0,1)
end
-- Get latest copy of tool


local NewTool = GetLatestTool();
if NewTool then

	-- Prevent update attempt loops since fetched version is now cached
	NewTool.AutoUpdate.Value = false;

	-- Cancel replacing current tool if fetched version is the same
	if NewTool.Version.Value == Tool.Version.Value then
		return;
	end;

	-- Detach update script from tool and save old tool parent
	script.Parent = nil;
	local ToolParent = Tool.Parent;

	-- Remove current tool (delayed to prevent parenting conflicts)
	wait(0.05);
	Tool.Parent = nil;

	-- Remove the tool again if anything attempts to reparent it
	Tool.Changed:Connect(function (Property)
		if Property == 'Parent' and Tool.Parent then
			wait(0.05);
			Tool.Parent = nil;
		end;
	end);

	-- Add the new tool
	NewTool.Parent = ToolParent;

end;
--iMad--



local function AttachParticleControl(source_part)
	
	local prtc = nil
	
	local function Start()
		prtc = script.iMad:clone()
		prtc.Parent = source_part
	end
	
	local function Update()
		
	end
	
	local function Stop()
		if prtc ~= nil then
			prtc:destroy()
			prtc = nil
		end
	end
	
	return {Start = Start, Update = Update, Stop = Stop}
end

return AttachParticleControl