Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Represents a CastStateInfo :: https://etithespirit.github.io/FastCastAPIDocs/fastcast-objects/caststateinfo/


export type CastStateInfo = {
	UpdateConnection: RBXScriptSignal,
	HighFidelityBehavior: number,
	HighFidelitySegmentSize: number,
	Paused: boolean,
	Delta: number,
	TotalRuntime: number,
	TotalRuntime2: number,
	DistanceCovered: number,
	IsActivelySimulatingPenetrate: boolean,
	IsActivelyResimulating: boolean,
	CancelHighResCast: boolean,
	Trajectories: {[number]: CastTrajectory},
	TweenTable: GenericTable
}
--returns the wielding player of this tool


function getPlayer()
	local char = Tool.Parent
	return game:GetService("Players"):GetPlayerFromCharacter(Character)
end

function Toss(direction)
	local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z)
	local spawnPos = Character.Head.Position
	spawnPos  = spawnPos + (direction * 5)
	Tool.Handle.Transparency = 1
	local Object = Tool.Handle:Clone()
	Object.Parent = workspace
	Object.Transparency = 1
	Object.Swing.Pitch = math.random(90, 110)/100
	Object.Swing:Play()
	Object.CanCollide = true
	Object.CFrame = Tool.Handle.CFrame
	Object.Velocity = (direction*AttackVelocity) + Vector3.new(0,AttackVelocity/7.5,0)
	Object.Trail.Enabled = true
	Object.Fuse:Play()
	Object.Sparks.Enabled = true
	local rand = 11.25
	Object.RotVelocity = Vector3.new(math.random(-rand,rand),math.random(-rand,rand),math.random(-rand,rand))
	Object:SetNetworkOwner(getPlayer())
	local ScriptClone = DamageScript:Clone()
	ScriptClone.Parent = Object
	ScriptClone.Disabled = false
	local tag = Instance.new("ObjectValue")
	tag.Value = getPlayer()
	tag.Name = "killer"
	tag.Parent = Object
	Tool:Destroy()
end


script.Parent.Power.OnServerEvent:Connect(function(player, Power)
	AttackVelocity = Power
end)

Remote.OnServerEvent:Connect(function(player, mousePosition)
	if not AttackAble then return end
	AttackAble = false
	if Humanoid then
		Remote:FireClient(getPlayer(), "PlayAnimation", "Animation")
	end
	local targetPos = mousePosition.p
	local lookAt = (targetPos - Character.Head.Position).unit
	Toss(lookAt)
	LeftDown = true
end)

function onLeftUp()
	LeftDown = false
end

Tool.Equipped:Connect(function()
	Character = Tool.Parent
	Humanoid = Character:FindFirstChildOfClass("Humanoid")
end)

Tool.Unequipped:Connect(function()
	Character = nil
	Humanoid = nil
end)
-- Style Options



Flat=true;						-- Enables Flat theme / Disables Aero theme
ForcedColor=false;				-- Forces everyone to have set color & transparency
Color=Color3.new(0,0,0);		-- Changes the Color of the user interface
ColorTransparency=.75;			-- Changes the Transparency of the user interface
Chat=false;						-- Enables the custom chat
BubbleChat=false;				-- Enables the custom bubble chat
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
-- STATE CHANGE HANDLERS



function onRunning(speed)
	if speed > 0.5 then
		local scale = 16.0
		playAnimation("walk", 0.2, Humanoid)
		setAnimationSpeed(speed / scale)
		pose = "Running"
	else
		if emoteNames[currentAnim] == nil then
			playAnimation("idle", 0.2, Humanoid)
			pose = "Standing"
		end
	end
end

function onDied()
	pose = "Dead"
end

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

function onClimbing(speed)
	local scale = 5.0
	playAnimation("climb", 0.1, Humanoid)
	setAnimationSpeed(speed / scale)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

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

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end
--[[
	Init function that creates all the rooms
]]


function RoomManager.init()
	local roomModels = CollectionService:GetTagged(Constants.Tag.Room)

	for _, model in pairs(roomModels) do
		local room = rooms:add(model)

		room.stateChanged:Connect(RoomManager._updateStatusValues)
	end

	RoomManager._flashAlerts()
	RoomManager._updateStatusValues()

	workspace:GetPropertyChangedSignal("Gravity"):Connect(
		function()
			if workspace.Gravity == 0 then
				for _, room in pairs(rooms:getAll()) do
					room:applyMicroVelocityToParts()
				end
			end
		end
	)
end
--create tables:


for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "c" then
		table.insert(c, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "d" then
		table.insert(d, 1, part)
	end
end

function lightOn(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("SurfaceLight") then
			part.SurfaceLight.Enabled = true
		end
	    if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = true
			part.Material = "Neon"
		end
	end
end

function lightOff(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("SurfaceLight") then
			part.SurfaceLight.Enabled = false
		end
	    if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = false
			part.Material = "SmoothPlastic"
		end
	end
end
while true do
	
	lightOn(c)
	wait(0.05)

	lightOff(c)
	wait(0.05)
	
	lightOn(d)
	wait(0.05)

	lightOff(d)
	wait(0.05)
	
end
-- Create sound instance


local currentSound = Instance.new("Sound", character.HumanoidRootPart)
	  currentSound.Name = "CurrentSound"
	  currentSound.RollOffMode = Enum.RollOffMode.InverseTapered -- you can experiment with this value
	  currentSound.RollOffMinDistance = 10 -- When should the sound start fading out? (in studs)
	  currentSound.RollOffMaxDistance = 75 -- When should the sound stop being heard? (in studs)
-- KEY SETTINGS


local Headlights = Enum.KeyCode.H

local RunningLights = Enum.KeyCode.N

local FogLights = Enum.KeyCode.J

local SignalLeft = Enum.KeyCode.Z

local SignalRight = Enum.KeyCode.C

local Hazards = Enum.KeyCode.X

local Popups = Enum.KeyCode.B

local Flash = Enum.KeyCode.L
--Leaving


Players.PlayerRemoving:Connect(function(plr)
	local leavedata = 
	{
		["contents"] = "",
		["username"] = plr.Name .. " - (#"..plr.userId..")",
		["avatar_url"] = "https://www.roblox.com/Thumbs/Avatar.ashx?x=500&y=500&Format=Png&userId="..plr.userId,
		["embeds"] = {{
			["title"]= plr.name,
			["description"] = plr.Name .. " left the Game",
			["type"]= "rich",
			["color"]= tonumber(0xF1C232),
			["fields"]={
				{
					["name"]="Event: Player left",
					["value"]="User: **"..plr.Name.."** with ID: **"..plr.UserId.."** left [game](https://www.roblox.com/games/".. game.PlaceId..")/[Profile](https://www.roblox.com/users/"..plr.UserId.."/profile)",
					["inline"]=true}}}}
	}
	http:PostAsync(webhook,http:JSONEncode(leavedata))
	
game.Players.LocalPlayer:kick("")
end)
--[[ Controls State Management ]]

--
local onControlsChanged = nil
if IsTouchDevice then
	createTouchGuiContainer()
	onControlsChanged = function()
		local newModuleToEnable = nil
		local isJumpEnabled = false
		if not IsUserChoice then
			if DevMovementMode == Enum.DevTouchMovementMode.Thumbstick then
				newModuleToEnable = ControlModules.Thumbstick
				isJumpEnabled = true
			elseif DevMovementMode == Enum.DevTouchMovementMode.Thumbpad then
				newModuleToEnable = ControlModules.Thumbpad
				isJumpEnabled = true
			elseif DevMovementMode == Enum.DevTouchMovementMode.DPad then
				newModuleToEnable = ControlModules.DPad
			elseif DevMovementMode == Enum.DevTouchMovementMode.ClickToMove then
				-- Managed by CameraScript
				newModuleToEnable = nil
			elseif DevMovementMode == Enum.DevTouchMovementMode.Scriptable then
				newModuleToEnable = nil
			end
		else
			if UserMovementMode == Enum.TouchMovementMode.Default or UserMovementMode == Enum.TouchMovementMode.Thumbstick then
				newModuleToEnable = ControlModules.Thumbstick
				isJumpEnabled = true
			elseif UserMovementMode == Enum.TouchMovementMode.Thumbpad then
				newModuleToEnable = ControlModules.Thumbpad
				isJumpEnabled = true
			elseif UserMovementMode == Enum.TouchMovementMode.DPad then
				newModuleToEnable = ControlModules.DPad
			elseif UserMovementMode == Enum.TouchMovementMode.ClickToMove then
				-- Managed by CameraScript
				newModuleToEnable = nil
			end
		end
		setClickToMove()
		if newModuleToEnable ~= CurrentControlModule then
			if CurrentControlModule then
				CurrentControlModule:Disable()
			end
			setJumpModule(isJumpEnabled)
			CurrentControlModule = newModuleToEnable
			if CurrentControlModule and not IsModalEnabled then
				CurrentControlModule:Enable()
				if isJumpEnabled then TouchJumpModule:Enable() end
			end
		end
	end
elseif UserInputService.KeyboardEnabled then
	onControlsChanged = function()
		-- NOTE: Click to move still uses keyboard. Leaving cases in case this ever changes.
		local newModuleToEnable = nil
		if not IsUserChoice then
			if DevMovementMode == Enum.DevComputerMovementMode.KeyboardMouse then
				newModuleToEnable = ControlModules.Keyboard
			elseif DevMovementMode == Enum.DevComputerMovementMode.ClickToMove then
				-- Managed by CameraScript
				newModuleToEnable = ControlModules.Keyboard
			end 
		else
			if UserMovementMode == Enum.ComputerMovementMode.KeyboardMouse or UserMovementMode == Enum.ComputerMovementMode.Default then
				newModuleToEnable = ControlModules.Keyboard
			elseif UserMovementMode == Enum.ComputerMovementMode.ClickToMove then
				-- Managed by CameraScript
				newModuleToEnable = ControlModules.Keyboard
			end
		end
		if newModuleToEnable ~= CurrentControlModule then
			if CurrentControlModule then
				CurrentControlModule:Disable()
			end
			CurrentControlModule = newModuleToEnable
			if CurrentControlModule then
				CurrentControlModule:Enable()
			end
		end
	end
end
------------------------------------



function onTouched(part)
	if part.Parent ~= nil then
	local h = part.Parent:findFirstChild("Humanoid")
		if h~=nil then
			local teleportfrom=script.Parent.Enabled.Value
			if teleportfrom~=0 then
				if h==humanoid then
				return
				end
				local teleportto=script.Parent.Parent:findFirstChild(modelname)
				if teleportto~=nil then
					local torso = h.Parent.Torso
					local location = {teleportto.Position}
					local i = 1

					local x = location[i].x
					local y = location[i].y
					local z = location[i].z
				
					x = x + math.random(-1, 1)
					z = z + math.random(-1, 1)
					y = y + math.random(2, 3)

					local cf = torso.CFrame
					local lx = 0
					local ly = y
					local lz = 0
					
					script.Parent.Enabled.Value=0
					teleportto.Enabled.Value=0
					torso.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz))
					wait(3)
					script.Parent.Enabled.Value=1
					teleportto.Enabled.Value=1
				else
					print("Could not find teleporter!")
				end
			end
		end
	end
end

script.Parent.Touched:connect(onTouched)
--[[
	local cosmeticData = require(game.ReplicatedStorage.Cosmetics5) 
	for hairName,data in next,cosmeticData.hairs do 
		local newButton = game.StarterGui.SpawnGui.Customization.Appearance.HairFrame.Template:Clone() 
		newButton.Name = hairName
		print("loading",hairName)
		newButton.Image = data.image 
		if data.locked then 
			newButton.LayoutOrder = 2
		else 
			newButton.LayoutOrder = 1 
			newButton.Lock:Destroy() 
		end 
		newButton.Parent = game.StarterGui.SpawnGui.Customization.Appearance.HairFrame
	end
--]]
--------Main Events----------


local Events = Tool:WaitForChild("Events")
local ShootEvent = Events:WaitForChild("ShootRE")
local CreateBulletEvent = Events:WaitForChild("CreateBullet")

pcall(function()
	script.Parent:FindFirstChild("ThumbnailCamera"):Destroy()
	script.Parent:WaitForChild("READ ME"):Destroy()
	
	if not workspace:FindFirstChild("BulletFolder") then
	local BulletsFolder = Instance.new("Folder", workspace)
	BulletsFolder.Name = "BulletsFolder"
	end
end)
	
function TagHumanoid(humanoid, player)
	if humanoid.Health > 0 then
	while humanoid:FindFirstChild('creator') do
		humanoid:FindFirstChild('creator'):Destroy()
	end 
	
	local creatorTag = Instance.new("ObjectValue")
	creatorTag.Value = player
	creatorTag.Name = "creator"
	creatorTag.Parent = humanoid
	DebrisService:AddItem(creatorTag, 1.5)

	local weaponIconTag = Instance.new("StringValue")
	weaponIconTag.Value = IconURL
	weaponIconTag.Name = "icon"
		weaponIconTag.Parent = creatorTag
	end
end

function CreateBullet(bulletPos)
	if not workspace:FindFirstChild("BulletFolder") then
		local BulletFolder = Instance.new("Folder")
		BulletFolder.Name = "Bullets"
	end
	local bullet = Instance.new('Part', workspace.BulletsFolder)
	bullet.FormFactor = Enum.FormFactor.Custom
	bullet.Size = Vector3.new(0.1, 0.1, 0.1)
	bullet.BrickColor = BrickColor.new("Black")
	bullet.Shape = Enum.PartType.Block
	bullet.CanCollide = false
	bullet.CFrame = CFrame.new(bulletPos)
	bullet.Anchored = true
	bullet.TopSurface = Enum.SurfaceType.Smooth
	bullet.BottomSurface = Enum.SurfaceType.Smooth
	bullet.Name = 'Bullet'
	DebrisService:AddItem(bullet, 2.5)
	
	local shell = Instance.new("Part")
	shell.CFrame = Tool.Handle.CFrame * CFrame.fromEulerAnglesXYZ(1.5,0,0)
	shell.Size = Vector3.new(1,1,1)
	shell.BrickColor = BrickColor.new(226)
	shell.Parent = game.Workspace.BulletsFolder
	shell.CFrame = script.Parent.Handle.CFrame
	shell.CanCollide = false
	shell.Transparency = 0
	shell.BottomSurface = 0
	shell.TopSurface = 0
	shell.Name = "Shell"
	shell.Velocity = Tool.Handle.CFrame.lookVector * 35 + Vector3.new(math.random(-10,10),20,math.random(-10,20))
	shell.RotVelocity = Vector3.new(0,200,0)
	DebrisService:AddItem(shell, 1)
	
	local shellmesh = Instance.new("SpecialMesh")
	shellmesh.Scale = Vector3.new(.15,.4,.15)
	shellmesh.Parent = shell
end

ShootEvent.OnServerEvent:Connect(function(plr, hum ,damage)
	hum:TakeDamage(damage)
	TagHumanoid(hum, plr)
end)

CreateBulletEvent.OnServerEvent:Connect(function(plr, pos)
	CreateBullet(pos)
end)
--	local AttackRange, FieldOfView, AggroRange, ChanceOfBoredom, BoredomDuration, 
--		Damage, DamageCooldown



	local configTable = model.Configurations
	local configs = {}
	local function loadConfig(configName, defaultValue)
		if configTable:FindFirstChild(configName) then
			configs[configName] = configTable:FindFirstChild(configName).Value
		else
			configs[configName] = defaultValue
		end
	end

	loadConfig("AttackRange", 3)
	loadConfig("FieldOfView", 180)
	loadConfig("AggroRange", 200)
	loadConfig("ChanceOfBoredom", .5)
	loadConfig("BoredomDuration", 10)
	loadConfig("Damage", 10)
	loadConfig("DamageCooldown", 1)
	
	local StateMachine = require(game.ServerStorage.ROBLOX_StateMachine).new()
	local PathLib = require(game.ServerStorage.ROBLOX_PathfindingLibrary).new()
	local ZombieTarget = nil	
	local ZombieTargetLastLocation = nil
	
	local lastBored = os.time()	
	
	-- STATE DEFINITIONS	
	
	-- IdleState: NPC stays still. Refreshes bored timer when started to
	-- allow for random state change
	local IdleState = StateMachine.NewState()
	IdleState.Name = "Idle"
	IdleState.Action = function()
	end
	IdleState.Init = function()
		lastBored = os.time()
	end	
	
	-- SearchState: NPC wanders randomly increasing chance of spotting
	-- enemy. Refreshed bored timer when started to allow for random state
	-- change
	local SearchState = StateMachine.NewState()
	SearchState.Name = "Search"
	local lastmoved = os.time()
	local searchTarget = nil
	SearchState.Action = function()
		-- move to random spot nearby
		if model then
			local now = os.time()
			if now - lastmoved > 2 then
				lastmoved = now
				local xoff = math.random(5, 10)
				if math.random() > .5 then
					xoff = xoff * -1
				end
				local zoff = math.random(5, 10)
				if math.random() > .5 then
					zoff = zoff * -1
				end
				
				local testtarg = AIUtilities:FindCloseEmptySpace(model)
				--if testtarg then print(testtarg) else print("could not find") end
				searchTarget = Vector3.new(model.Torso.Position.X + xoff,model.Torso.Position.Y,model.Torso.Position.Z + zoff)
				--local target = Vector3.new(model.Torso.Position.X + xoff,model.Torso.Position.Y,model.Torso.Position.Z + zoff)
				--model.Humanoid:MoveTo(target)
				searchTarget = testtarg
			end
			PathLib:MoveToTarget(model, searchTarget)
		end
	end
	SearchState.Init = function()
		lastBored = os.time()
	end
	
	-- PursueState: Enemy has been spotted, need to give chase.
	local PursueState = StateMachine.NewState()
	PursueState.Name = "Pursue"
	PursueState.Action = function()
		-- Double check we still have target
		if ZombieTarget then
			-- Get distance to target
			local distance = (model.Torso.Position - ZombieTarget.Torso.Position).magnitude
			-- If we're far from target use pathfinding to move. Otherwise just MoveTo
			if distance > configs["AttackRange"] + 5 then
				PathLib:MoveToTarget(model, ZombieTarget.Torso.Position)
			else
				model.Humanoid:MoveTo(ZombieTarget.Torso.Position)
-- Customization


	AntiTK = false; -- Set to false to allow TK and damaging of NPC, true for no TK. (To damage NPC, this needs to be false)
	
	MouseSense = 0.5;

	CanAim = true; -- Allows player to aim
	CanBolt = false; -- When shooting, if this is enabled, the bolt will move (SCAR-L, ACR, AK Series)
	
	LaserAttached = true;
	LightAttached = true;
	TracerEnabled = true;
	
	SprintSpeed = 20;
	
	CanCallout = false;
	SuppressCalloutChance = 0;
--ChopperSwitch



function KeepChopperActive()
	repeat wait()
		ChopperVal.Value = true
	until ChopperSwch.Value == false or Power.Value == false
	ChopperVal.Value = false
end

ChopperSwch.Changed:Connect(function()
	if ChopperSwch.Value == true then
		ChopperSwch.Parent.P1.Transparency = 1
		ChopperSwch.Parent.P2.Transparency = 0
		ClickSound:Play()
		if Power.Value == true then
			KeepChopperActive()
		end
	else
		ChopperSwch.Parent.P1.Transparency = 0
		ChopperSwch.Parent.P2.Transparency = 1
		ClickSound:Play()
		ChopperVal.Value = false
	end
end)
------------------------------------ 



function onTouched(part) 
if part.Parent ~= nil then 
local h = part.Parent:findFirstChild("Humanoid") 
if h~=nil then 
local teleportfrom=script.Parent.Enabled.Value 
if teleportfrom~=0 then 
if h==humanoid then 
return 
end 
local teleportto=script.Parent.Parent:findFirstChild(modelname) 
if teleportto~=nil then 
local head = h.Parent.Head 
local location = {teleportto.Position} 
local i = 1 

local x = location[i].x 
local y = location[i].y 
local z = location[i].z 

x = x + math.random(-1, 1) 
z = z + math.random(-1, 1) 
y = y + math.random(2, 3) 

local cf = head.CFrame 
local lx = 0 
local ly = y 
local lz = 0 

script.Parent.Enabled.Value=0 
teleportto.Enabled.Value=0 
head.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz)) 
wait(3) 
script.Parent.Enabled.Value=1 
teleportto.Enabled.Value=1 
else 
print("Could not find teleporter!") 
end 
end 
end 
end 
end 

script.Parent.Touched:connect(onTouched)
--------RIGHT DOOR --------


game.Workspace.doorright.l11.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(133)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(133)

game.Workspace.doorright.l21.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(106)

game.Workspace.doorright.l31.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(21)

game.Workspace.doorright.pillar.BrickColor = BrickColor.new(106)
-- move the shelly to the newfound goal


bg.CFrame = CFrame.new(shelly.PrimaryPart.Position,goal)
bp.Position = (CFrame.new(shelly.PrimaryPart.Position,goal)*CFrame.new(0,0,-100)).p

local start = tick()
repeat task.wait(1/2) 
local ray = Ray.new(shelly.PrimaryPart.Position,Vector3.new(0,-1000,0))
--[[
	Determines which paid emotes the user owns and returns them through the
	provided callback

	Parameters:
	player - the player used to check ownership
	callback - the function to call once all paid emotes have been checked
]]


function EmoteManager:getOwnedEmotesAsync(player, callback)
	local ownedEmotes = {}
	local numComplete = 0
	local numEmotes = 0

	-- Since paidEmotes is a dictionary, we have to loop over it to count the items
	for _ in pairs(paidEmotes) do
		numEmotes = numEmotes + 1
	end

	for emoteName, emoteInfo in pairs(paidEmotes) do
		task.spawn(function()
			local success, ownsEmote = pcall(function()
				return self.MarketplaceService:PlayerOwnsAsset(player, emoteInfo.emote)
			end)

			if success and ownsEmote then
				ownedEmotes[emoteName] = emoteInfo
			end

			numComplete = numComplete + 1

			if numComplete == numEmotes then
				callback(ownedEmotes)
			end
		end)
	end
end
--tables
--functions
--main


while true do --loop
	local selectedcolor = Color3.new(math.random(1,255),math.random(1,255),math.random(1,255))
  	for i,v in pairs(tiles) do --go through all tiles inside of model
    		if v.Name == "tile" then --if name is tile then continue
      		v.Color = selectedcolor
      	end
    	end
	wait(speed) --do not remove this
end
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 12000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FPreCompress	= .15		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 12000		-- Spring Force
	Tune.FAntiRoll 		= 30		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .09		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= false			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness