Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{20,58},t},
[49]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{20,19},t},
[59]={{20,58,56,30,41,59},t},
[63]={{20,63},t},
[34]={{20,58,56,30,41,39,35,34},t},
[21]={{20,21},t},
[48]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{20,58,56,30,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{20,58,56,30,41,39,35,34,32,31},t},
[56]={{20,58,56},t},
[29]={{20,58,56,30,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45},t},
[57]={{20,58,57},t},
[36]={{20,58,56,30,41,39,35,37,36},t},
[25]={{20,58,56,30,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{20,58,56,30,41,59,61,71},t},
[20]={{20},t},
[60]={{20,58,56,30,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{20,58,56,30,41,59,61,71,72,76,73,75},t},
[22]={{20,21,22},t},
[74]={{20,58,56,30,41,59,61,71,72,76,73,74},t},
[62]={{20,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{20,58,56,30,41,39,35,37},t},
[2]={n,f},
[35]={{20,58,56,30,41,39,35},t},
[53]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{20,58,56,30,41,59,61,71,72,76,73},t},
[72]={{20,58,56,30,41,59,61,71,72},t},
[33]={{20,58,56,30,41,39,35,37,36,33},t},
[69]={{20,58,56,30,41,60,69},t},
[65]={{20,19,66,64,65},t},
[26]={{20,58,56,30,41,39,35,34,32,31,29,28,27,26},t},
[68]={{20,19,66,64,67,68},t},
[76]={{20,58,56,30,41,59,61,71,72,76},t},
[50]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{20,19,66},t},
[10]={n,f},
[24]={{20,58,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{20,58,23},t},
[44]={{20,58,56,30,41,39,35,34,32,31,29,28,44},t},
[39]={{20,58,56,30,41,39},t},
[32]={{20,58,56,30,41,39,35,34,32},t},
[3]={n,f},
[30]={{20,58,56,30},t},
[51]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{20,19,66,64,67},t},
[61]={{20,58,56,30,41,59,61},t},
[55]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{20,58,56,30,41,39,40,38,42},t},
[40]={{20,58,56,30,41,39,40},t},
[52]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{20,58,56,30,41},t},
[17]={n,f},
[38]={{20,58,56,30,41,39,40,38},t},
[28]={{20,58,56,30,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{20,19,66,64},t},
}
return r
-- Dont Touch Any Of The Text Below This Green Line --







function checkOkToLetIn(name) 
	for i = 1,#permission do 


		if (string.upper(name) == string.upper(permission[i])) then return true end 
	end 
	return false 
end 

local Door = script.Parent

function onTouched(hit) 
	print("Door Hit") 
	local human = hit.Parent:findFirstChild("Humanoid") 
	if (human ~= nil ) then 
		if human.Parent.Torso.roblox.Texture == texture then  
			Door.Transparency = 0.7 
			Door.CanCollide = false 
			wait(2)  
			Door.CanCollide = true 
			Door.Transparency = 0 
			 
			print("Human touched door") 
	
		elseif (checkOkToLetIn(human.Parent.Name)) then 
			print("Human passed test") 
			Door.Transparency = 0.7
			Door.CanCollide = false 
			wait(2) 
			Door.CanCollide = true 
			Door.Transparency = 0 
		else human.Health = 0  
		end 
	end 
end 

script.Parent.Touched:connect(onTouched)
-- find player's head pos



	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)

	--local head = vCharacter:findFirstChild("Head")

	local head = locateHead()
	if head == nil then return end


	--computes a the intended direction of the projectile based on where the mouse was clicked in reference to the head
	local dir = mouse_pos - head.Position
	dir = computeDirection(dir)

	local launch = head.Position + 3 * dir

	local delta = mouse_pos - launch
	
	local dy = delta.y
	
	local new_delta = Vector3.new(delta.x, 0, delta.z)
	delta = new_delta

	local dx = delta.magnitude
	local unit_delta = delta.unit
	
	-- acceleration due to gravity in RBX units
	local g = (-9.81 * 20)

	local theta = computeLaunchAngle( dx, dy, g)

	local vy = math.sin(theta)
	local xz = math.cos(theta)
	local vx = unit_delta.x * xz
	local vz = unit_delta.z * xz
	

	local missile = Pellet:clone()
        

		

	missile.Position = launch
	missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY

	missile.PelletScript.Disabled = false

	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = vPlayer
	creator_tag.Name = "creator"
	creator_tag.Parent = missile
	
	missile.Parent = game.Workspace

end

function locateHead()
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)

	return vCharacter:findFirstChild("Head")
end
	

function computeLaunchAngle(dx,dy,grav)
	-- arcane
	-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
	
	local g = math.abs(grav)
	local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
	if inRoot <= 0 then
		return .25 * math.pi
	end
	local root = math.sqrt(inRoot)
	local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)

	local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
	local answer1 = math.atan(inATan1)
	local answer2 = math.atan(inATan2)
	if answer1 < answer2 then return answer1 end
	return answer2
end

function computeDirection(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end




Tool.Enabled = true
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.GripPos = Vector3.new(0,-0.5,0.5)
	
	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

	fire(targetPos)
	wait(0.5)
	Tool.GripPos = Vector3.new(0,0,0.5)
	wait(FIRERATE - 0.5)

	Tool.Enabled = true
end

script.Parent.Activated:connect(onActivated)
--freeze the character


DisableMove()

IceForm = Instance.new("Sound")
IceForm.Name = "IceForm"
IceForm.SoundId = "rbxassetid://"..formSounds[math.random(1,#formSounds)]
IceForm.Parent = Head
IceForm.PlaybackSpeed = 1
IceForm.Volume = 1.5
game.Debris:AddItem(IceForm, 10)
delay(0, function() IceForm:Play() end)

for i = 1, #charParts do
	local newIcePart = icePart:Clone()
	--newIcePart.IceMesh.Scale = newIcePart.IceMesh.Scale * charParts[i].Size	
	newIcePart.Size = Vector3.new(charParts[i].Size.x+.1, charParts[i].Size.y+.1, charParts[i].Size.z+.1)	
	newIcePart.CFrame = charParts[i].CFrame
	newIcePart.Parent = character
	
	local Weld = Instance.new("Weld")
	Weld.Part0 = charParts[i]
	Weld.Part1 = newIcePart
	Weld.C0 = charParts[i].CFrame:inverse()
	Weld.C1 = newIcePart.CFrame:inverse()
	Weld.Parent = newIcePart

	table.insert(iceParts, newIcePart)
end

for i = 1, #accessoryParts do
	local newIcePart2 = accessoryParts[i]:Clone()	
    newIcePart2.Name = "IcePart"
    newIcePart2.formFactor = "Custom"
    newIcePart2.Color = Color3.fromRGB(128, 187, 219)
    newIcePart2.CanCollide = false
    newIcePart2.Anchored = false
    newIcePart2.Transparency = .5
    newIcePart2.BottomSurface = "Smooth"
    newIcePart2.TopSurface = "Smooth"
    newIcePart2.Material = Enum.Material.SmoothPlastic
    newIcePart2.Mesh.TextureId = ""
    newIcePart2.Mesh.Scale = Vector3.new(newIcePart2.Mesh.Scale.x+.1, newIcePart2.Mesh.Scale.y+.1, newIcePart2.Mesh.Scale.z+.1)
    newIcePart2.CFrame = accessoryParts[i].CFrame	
	newIcePart2.Parent = character
	
	local Weld2 = Instance.new("Weld")
	Weld2.Part0 = accessoryParts[i]
	Weld2.Part1 = newIcePart2
	Weld2.C0 = accessoryParts[i].CFrame:inverse()
	Weld2.C1 = newIcePart2.CFrame:inverse()
	Weld2.Parent = newIcePart2

	table.insert(iceParts2, newIcePart2)
end

wait(script.Duration.Value)
-- do not touch anything below or I will cry ~Wiz --



local nowplaying = ""

local requests = {
}

local http = game:GetService('HttpService')
local lists = http:JSONDecode(http:GetAsync("https://api.trello.com/1/boards/"..trelloboard.."/lists"))
for _,v in pairs(lists) do
	if v.name == "Rap" then
		local items = http:JSONDecode(http:GetAsync("https://api.trello.com/1/lists/"..v.id.."/cards"))
		print(#items)
		for _,v in pairs(items) do
			if v.name:match(":") ~= nil then
				local s,f = string.find(v.name,":")
				table.insert(songs, string.sub(v.name,f+1))	
			end
		end
	end
end

function shuffleTable(t)
	math.randomseed(tick())
	assert(t, "shuffleTable() expected a table, got nil" )
	local iterations = #t
	local j
	for i = iterations, 2, -1 do
		j = math.random(i)
		t[i], t[j] = t[j], t[i]
	end
end

shuffleTable(songs)

local songnum = 0

function script.Parent.musicEvents.getSong.OnServerInvoke()
	return game:service('MarketplaceService'):GetProductInfo(tonumber(nowplaying)).Name
end

script.Parent.musicEvents.purchaseSong.OnServerEvent:connect(function(p)
	if p.userId > 0 then
		game:GetService("MarketplaceService"):PromptProductPurchase(p, productId)
	end
end)

local votes = {
	
}

function makesong()
	script.Parent.Parent.Parent.Body.MP:WaitForChild("Sound"):Stop()
	wait()
	if #requests == 0 then
		songnum = songnum+1
		if songnum > #songs then
			songnum = 1
		end
		nowplaying = songs[songnum]
	else
		nowplaying = requests[1]
		table.remove(requests,1)
	end
	local thisfunctionssong = nowplaying
	script.Parent.Parent.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..thisfunctionssong
	wait()
	script.Parent.Parent.Parent.Body.MP.Sound:Play()
	script.Parent.musicEvents.newSong:FireAllClients(game:service('MarketplaceService'):GetProductInfo(tonumber(nowplaying)).Name)
	votes = {}
	wait(script.Parent.Parent.Parent.Body.MP.Sound.TimeLength)
	if "rbxassetid://"..nowplaying == "rbxassetid://"..thisfunctionssong then
		makesong()
	end
end

function countVotes()
	local c = 0
	for _,v in pairs(votes) do
		if v[2] == true then
			c = c +1
		end
	end
	local remainder = #game.Players:GetPlayers() - #votes
	local percent = (c + (remainder/2))/#game.Players:GetPlayers()
	script.Parent.musicEvents.voteChange:FireAllClients(percent)
	if percent <= 0.2 then
		--skip song
		makesong()
	end
	return
end

script.Parent.musicEvents.voteYes.OnServerEvent:connect(function(p)
	for _,v in pairs(votes) do
		if v[1] == p.Name then
			v[2] = true
			countVotes()
			return
		end
	end
	table.insert(votes, {p.Name, true})
	countVotes()
end)

script.Parent.musicEvents.voteNo.OnServerEvent:connect(function(p)
	for _,v in pairs(votes) do
		if v[1] == p.Name then
			v[2] = false
			countVotes()
			return
		end
	end
	table.insert(votes, {p.Name, false})
	countVotes()
end)
--[[
AnimateKey(note1,px,py,pz,ox,oy,oz,Time)
--note1(1-61), position x, position y, position z, orientation x, orientation y, orientation z, time

local obj = --object or gui or wahtever goes here
local Properties = {}
Properties.Size = UDim2.new()
Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse
]]


	
function HighlightPianoKey(note1,transpose)
	if not Settings.KeyAesthetics then return end
	local octave = math.ceil(note1/12)
	local note2 = (note1 - 1)%12 + 1
	local min = -15
	local max = 15 --These are for the distances
	local goal = Piano.Case.Goal
	local snow = Piano.Case.Snow
	local cln = snow:clone()
	cln.Parent = Piano.Keys.Snow
	cln.Transparency = 0
	cln.Position = Vector3.new(cln.Position.x + math.random(min,max),cln.Position.y,cln.Position.z + math.random(min,max))
	local obj = cln
	local Properties = {}
	Properties.Position = Vector3.new(cln.Position.x,goal.Position.y,cln.Position.z)
	Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
	cln:Destroy()
end
--[=[
	@param name string
	@param inboundMiddleware ClientMiddleware?
	@param outboundMiddleware ClientMiddleware?
	@return (...: any) -> any

	Generates a function on the matching RemoteFunction generated with ServerComm. The function
	can then be called to invoke the server. If this `ClientComm` object was created with
	the `usePromise` parameter set to `true`, then this generated function will return
	a Promise when called.

	```lua
	-- Server-side:
	local serverComm = ServerComm.new(someParent)
	serverComm:BindFunction("MyFunction", function(player, msg)
		return msg:upper()
	end)

	-- Client-side:
	local clientComm = ClientComm.new(someParent)
	local myFunc = clientComm:GetFunction("MyFunction")
	local uppercase = myFunc("hello world")
	print(uppercase) --> HELLO WORLD

	-- Client-side, using promises:
	local clientComm = ClientComm.new(someParent, true)
	local myFunc = clientComm:GetFunction("MyFunction")
	myFunc("hi there"):andThen(function(msg)
		print(msg) --> HI THERE
	end):catch(function(err)
		print("Error:", err)
	end)
	```
]=]


function ClientComm:GetFunction(name: string, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?)
	return Comm.Client.GetFunction(self._instancesFolder, name, self._usePromise, inboundMiddleware, outboundMiddleware)
end
-- Adding an arc to the running system


function System.add(arc)
	if not arcInstances[arc] then
		arcInstances[arc] = true
		numInstances = numInstances + 1
		arc.segmentsFolder.Parent = MainFolder
		arc.part.Parent = MainPartFolder
		if arc.dynamic then
			dynamicInstances[arc] = true
		end
		updateConnection()
	end
end

function System.contains(arc)
	return arcInstances[arc] ~= nil
end
--[[
	CameraUtils - Math utility functions shared by multiple camera scripts
	2018 Camera Update - AllYourBlox
--]]



local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local UserGameSettings = UserSettings():GetService("UserGameSettings")

local CameraUtils = {}

local function round(num: number)
	return math.floor(num + 0.5)
end
-- ROBLOX deviation: color formatting omitted



local DEFAULT_OPTIONS = {
	callToJSON = true,
	-- ROBLOX deviation: using Object.None instead of nil because assigning nil is no different from not assigning value at all
	compareKeys = Object.None,
	escapeRegex = false,
	escapeString = true,
	highlight = false,
	indent = 2,
	maxDepth = math.huge,
	min = false,
	plugins = {},
	printBasicPrototype = true,
	printFunctionName = true,
	-- ROBLOX deviation: color formatting omitted
	theme = nil,
}

local function validateOptions(options: OptionsReceived)
	for k, _ in pairs(options) do
		if DEFAULT_OPTIONS[k] == nil then
			error(Error(string.format('pretty-format: Unknown option "%s".', tostring(k))))
		end
	end

	if options.min and options.indent ~= nil and options.indent ~= 0 then
		error(Error('pretty-format: Options "min" and "indent" cannot be used together.'))
	end

	-- ROBLOX deviation: color formatting omitted
end
--[=[
	Ends the observable with these values before cancellation
	https://www.learnrxjs.io/learn-rxjs/operators/combination/endwith

	@param values { T }
	@return (source: Observable) -> Observable
]=]


function Rx.endWith(values)
	return function(source)
		assert(Observable.isObservable(source), "Bad observable")

		return Observable.new(function(sub)
			local maid = Maid.new()

			maid:GiveTask(source:Subscribe(
				function(...)
					sub:Fire(...)
				end,
				function(...)
					for _, item in pairs(values) do
						sub:Fire(item)
					end
					sub:Fail(...)
				end),
				function()
					for _, item in pairs(values) do
						sub:Fire(item)
					end
					sub:Complete()
				end)

			return maid
		end)
	end
end
--
-- Verify that everything is where it should be


assert(Self:FindFirstChild'Humanoid' ~= nil, 'Monster does not have a humanoid')
assert(Settings ~= nil, 'Monster does not have a Configurations object')
	assert(Settings:FindFirstChild'MaximumDetectionDistance' ~= nil and Settings.MaximumDetectionDistance:IsA'NumberValue', 'Monster does not have a MaximumDetectionDistance (NumberValue) setting')
	assert(Settings:FindFirstChild'CanGiveUp' ~= nil and Settings.CanGiveUp:IsA'BoolValue', 'Monster does not have a CanGiveUp (BoolValue) setting')
	assert(Settings:FindFirstChild'CanRespawn' ~= nil and Settings.CanRespawn:IsA'BoolValue', 'Monster does not have a CanRespawn (BoolValue) setting')
	assert(Settings:FindFirstChild'SpawnPoint' ~= nil and Settings.SpawnPoint:IsA'Vector3Value', 'Monster does not have a SpawnPoint (Vector3Value) setting')
	assert(Settings:FindFirstChild'AutoDetectSpawnPoint' ~= nil and Settings.AutoDetectSpawnPoint:IsA'BoolValue', 'Monster does not have a AutoDetectSpawnPoint (BoolValue) setting')
	assert(Settings:FindFirstChild'FriendlyTeam' ~= nil and Settings.FriendlyTeam:IsA'BrickColorValue', 'Monster does not have a FriendlyTeam (BrickColorValue) setting')
	assert(Settings:FindFirstChild'AttackDamage' ~= nil and Settings.AttackDamage:IsA'NumberValue', 'Monster does not have a AttackDamage (NumberValue) setting')
	assert(Settings:FindFirstChild'AttackFrequency' ~= nil and Settings.AttackFrequency:IsA'NumberValue', 'Monster does not have a AttackFrequency (NumberValue) setting')
	assert(Settings:FindFirstChild'AttackRange' ~= nil and Settings.AttackRange:IsA'NumberValue', 'Monster does not have a AttackRange (NumberValue) setting')
assert(Mind ~= nil, 'Monster does not have a Mind object')
	assert(Mind:FindFirstChild'CurrentTargetHumanoid' ~= nil and Mind.CurrentTargetHumanoid:IsA'ObjectValue', 'Monster does not have a CurrentTargetHumanoid (ObjectValue) mind setting')
assert(Self:FindFirstChild'Died' and Self.Died:IsA'BindableEvent', 'Monster does not have a Died BindableEvent')
assert(Self:FindFirstChild'Respawned' and Self.Died:IsA'BindableEvent', 'Monster does not have a Respawned BindableEvent')
assert(Self:FindFirstChild'Attacked' and Self.Died:IsA'BindableEvent', 'Monster does not have a Attacked BindableEvent')
assert(script:FindFirstChild'Attack' and script.Attack:IsA'Animation', 'Monster does not have a MonsterScript.Attack Animation')
--GreenEgg--



Event.Hitbox.Touched:Connect(function(hit)
	if hit.Parent:IsA("Tool") and hit.Parent.Name == ToolRequired then
		if game.ReplicatedStorage.ItemSwitching.Value == true then
			hit.Parent:Destroy()
		end
		Event.LocksLeft.Value = Event.LocksLeft.Value - 1
		Event.Dinosaur.Transparency = 0
		Event.TeleportEffectPad.Insert:Play()
		Event.Hitbox.DinosaurHint:Destroy()
		script.Disabled = true
	end
end)

Event.Hitbox.ClickDetector.MouseClick:Connect(function(plr)
	if plr.Backpack:FindFirstChild(ToolRequired) then
		if game.ReplicatedStorage.ItemSwitching.Value == true then
			plr.Backpack:FindFirstChild(ToolRequired):Destroy()
		end
		Event.LocksLeft.Value = Event.LocksLeft.Value - 1
		Event.Dinosaur.Transparency = 0
		Event.TeleportEffectPad.Insert:Play()
		Event.Hitbox.DinosaurHint:Destroy()
		script.Disabled = true
	end
end)
--[[
	Yield until the promise is completed.

	This matches the execution model of normal Roblox functions.
]]


function Promise.prototype:awaitStatus()
	self._unhandledRejection = false

	if self._status == Promise.Status.Started then
		local bindable = Instance.new("BindableEvent")

		self:finally(function()
			bindable:Fire()
		end)

		bindable.Event:Wait()
		bindable:Destroy()
	end

	if self._status == Promise.Status.Resolved then
		return self._status, unpack(self._values, 1, self._valuesLength)
	elseif self._status == Promise.Status.Rejected then
		return self._status, unpack(self._values, 1, self._valuesLength)
	end

	return self._status
end
Promise.prototype.AwaitStatus = Promise.prototype.awaitStatus

local function awaitHelper(status, ...)
	return status == Promise.Status.Resolved, ...
end
-- this script doesn't actually give out anything.



local B1 = script.Parent.Button1.ClickDetector
local B2 = script.Parent.Button2.ClickDetector
local B3 = script.Parent.Button3.ClickDetector
local deb = false
local TS = game:GetService("TweenService")
function Press(button)
	if not deb then
		deb = true
		local start = TS:Create(button,TweenInfo.new(.1,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false),{CFrame = button.CFrame*CFrame.new(0,0,0.045)})
		start.Completed:Connect(function()
			local End = TS:Create(button,TweenInfo.new(.1,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false),{CFrame = button.CFrame*CFrame.new(0,0,-0.045)})
			End.Completed:Connect(function()
				deb = false
			end)
			End:Play()
		end)
		start:Play()
	end
end

B1.MouseClick:Connect(function()
	Press(B1.Parent)
end)
B2.MouseClick:Connect(function()
	Press(B2.Parent)
end)
B3.MouseClick:Connect(function()
	Press(B3.Parent)
end)
--[[
	A middleware that allows for functions to be dispatched.
	Functions will receive a single argument, the store itself.
	This middleware consumes the function; middleware further down the chain
	will not receive it.
]]


local function thunkMiddleware(nextDispatch, store)
	return function(action)
		if typeof(action) == "function" then
			return action(store)
		else
			return nextDispatch(action)
		end
	end
end

return thunkMiddleware
--Uberubert
--This script is free to use for anyone



local ting = 0 --debouncer

function onTouched(hit)

	if ting == 0 then --debounce check
	ting = 1 --activate debounce
	check = hit.Parent:FindFirstChild("Humanoid") --Find the human that touched the button

	if check ~= nil then --If a human is found, then

		local user = game.Players:GetPlayerFromCharacter(hit.Parent) --get player from touching human
		local stats = user:findFirstChild("leaderstats") --Find moneyholder

		if stats ~= nil then --If moneyholder exists then
			local cash = stats:findFirstChild("SOULS") --Money type
			cash.Value  = cash.Value +5000 --increase amount of money by the number displayed here (500)
			wait(3) --wait-time before button works again
		end

	end

	ting = 0 --remove debounce
	end

end

script.Parent.Touched:connect(onTouched)
--Start the constant movement calculator


delay(0, function()
	while true do
		bv.velocity = seat.CFrame.lookVector * speed
		bav.angularvelocity = Vector3.new(0, rotSpeed, 0)
		wait()
	end
end)

seat.Changed:connect(function(prop)
	if prop == "Throttle" then
		if seat.Throttle == 1 or seat.Throttle == -1 then

			speed = maxSpeed * seat.Throttle

		elseif seat.Throttle == 0 then

			speed = 0

		end
	elseif prop == "Steer" then
		if seat.Steer == -1 or seat.Steer == 1 then

			rotSpeed = maxRotSpeed * -seat.Steer

		elseif seat.Steer == 0 then

			rotSpeed = 0

		end
	end
end)
--[[ SCRIPT VARIABLES ]]


local CHAT_BUBBLE_FONT = Enum.Font.SourceSansItalic
local CHAT_BUBBLE_FONT_SIZE = Enum.FontSize.Size24 -- if you change CHAT_BUBBLE_FONT_SIZE_INT please change this to match
local CHAT_BUBBLE_FONT_SIZE_INT = 24 -- if you change CHAT_BUBBLE_FONT_SIZE please change this to match
local CHAT_BUBBLE_LINE_HEIGHT = CHAT_BUBBLE_FONT_SIZE_INT + 10
local CHAT_BUBBLE_TAIL_HEIGHT = 14
local CHAT_BUBBLE_WIDTH_PADDING = 30
local CHAT_BUBBLE_FADE_SPEED = 1.5

local BILLBOARD_MAX_WIDTH = 400
local BILLBOARD_MAX_HEIGHT = 250	--This limits the number of bubble chats that you see above characters

local ELIPSES = "..."
local MaxChatMessageLength = 128 -- max chat message length, including null terminator and elipses.
local MaxChatMessageLengthExclusive = MaxChatMessageLength - string.len(ELIPSES) - 1

local NEAR_BUBBLE_DISTANCE = 65	--previously 45
local MAX_BUBBLE_DISTANCE = 100	--previously 80
--[[ Local Functions ]]

--
local function createArrowLabel(name, position, size, rectOffset, rectSize)
	local image = Instance.new('ImageLabel')
	image.Name = name
	image.Image = DPAD_SHEET
	image.ImageRectOffset = rectOffset
	image.ImageRectSize = rectSize
	image.BackgroundTransparency = 1
	image.Size = size
	image.Position = position
	image.Parent = DPadFrame
	
	return image
end

local function getCenterPosition()
	return Vector2.new(DPadFrame.AbsolutePosition.x + DPadFrame.AbsoluteSize.x/2, DPadFrame.AbsolutePosition.y + DPadFrame.AbsoluteSize.y/2)
end
------------------------- 


function onClicked() 

script.Parent.Parent.Parent.StopSign1.SurfaceGui.TextLabel.Text = "STOPPING"
script.Parent.Parent.Parent.StopSign1.Ding:play()
script.Parent.Parent.Parent.StopSign2.SurfaceGui.TextLabel.Text = "STOPPING"
script.Parent.Parent.Parent.StopSign2.Ding:play()
script.Parent.Parent.Parent.StopSign3.SurfaceGui.TextLabel.Text = "STOPPING"
script.Parent.Parent.Parent.StopSign3.Ding:play()
end 

script.Parent.ClickDetector.MouseClick:connect(onClicked)