Roblox/luau_corpus huggingface dataset:
--[[ The Module ]]--
local BaseCamera = require(script.Parent:WaitForChild("BaseCamera"))
local VRBaseCamera = setmetatable({}, BaseCamera)
VRBaseCamera.__index = VRBaseCamera

function VRBaseCamera.new()
	local self = setmetatable(BaseCamera.new(), VRBaseCamera)

	-- distance is different in VR
	self.defaultDistance = VR_ZOOM
	self.defaultSubjectDistance = math.clamp(self.defaultDistance, player.CameraMinZoomDistance, player.CameraMaxZoomDistance)
	self.currentSubjectDistance = math.clamp(self.defaultDistance, player.CameraMinZoomDistance, player.CameraMaxZoomDistance)

	-- VR screen effect
	self.VRFadeResetTimer = 0
	self.VREdgeBlurTimer = 0

	-- initialize vr specific variables
	self.gamepadResetConnection = nil
	self.needsReset = true

	return self
end

function VRBaseCamera:GetModuleName()
	return "VRBaseCamera"
end

function VRBaseCamera:GamepadZoomPress()
	local dist = self:GetCameraToSubjectDistance()

	if dist > VR_ZOOM / 2 then
		self:SetCameraToSubjectDistance(0)
		self.currentSubjectDistance = 0
	else
		self:SetCameraToSubjectDistance(VR_ZOOM)
		self.currentSubjectDistance = VR_ZOOM
	end

	self:GamepadReset()
	self:ResetZoom()
end

function VRBaseCamera:GamepadReset()
	self.needsReset = true
end

function VRBaseCamera:ResetZoom()
	ZoomController.SetZoomParameters(self.currentSubjectDistance, 0)
	ZoomController.ReleaseSpring()
end

function VRBaseCamera:OnEnable(enable: boolean)
	if enable then
		self.gamepadResetConnection = CameraInput.gamepadReset:Connect(function()
			self:GamepadReset()
		end)
	else
		-- make sure zoom is reset when switching to another camera
		if self.inFirstPerson then
			self:GamepadZoomPress()
		end

		if self.gamepadResetConnection then
			self.gamepadResetConnection:Disconnect()
			self.gamepadResetConnection = nil
		end

		-- reset VR effects
		self.VREdgeBlurTimer = 0
		self:UpdateEdgeBlur(player, 1)
		local VRFade = Lighting:FindFirstChild("VRFade")
		if VRFade then
			VRFade.Brightness = 0
		end
	end
end

function VRBaseCamera:UpdateDefaultSubjectDistance()
	self.defaultSubjectDistance = math.clamp(VR_ZOOM, player.CameraMinZoomDistance, player.CameraMaxZoomDistance)
end
-- Keyboard
-- Stephen Leitnick
-- October 10, 2021


local Trove = require(script.Parent.Parent.Trove)
local Signal = require(script.Parent.Parent.Signal)

local UserInputService = game:GetService("UserInputService")
--[[
	Unpacks an animatable type into an array of numbers.
	If the type is not animatable, an empty array will be returned.
]]

local Package = script.Parent.Parent
local Types = require(Package.Types)
local Oklab = require(Package.Colour.Oklab)

local function unpackType(value: Types.Animatable, typeString: string): {number}
	if typeString == "number" then
		return {value}

	elseif typeString == "CFrame" then
		-- FUTURE: is there a better way of doing this? doing distance
		-- calculations on `angle` may be incorrect
		local axis, angle = value:ToAxisAngle()
		return {value.X, value.Y, value.Z, axis.X, axis.Y, axis.Z, angle}

	elseif typeString == "Color3" then
		local lab = Oklab.to(value)
		return {lab.X, lab.Y, lab.Z}

	elseif typeString == "ColorSequenceKeypoint" then
		local lab = Oklab.to(value.Value)
		return {lab.X, lab.Y, lab.Z, value.Time}

	elseif typeString == "DateTime" then
		return {value.UnixTimestampMillis}

	elseif typeString == "NumberRange" then
		return {value.Min, value.Max}

	elseif typeString == "NumberSequenceKeypoint" then
		return {value.Value, value.Time, value.Envelope}

	elseif typeString == "PhysicalProperties" then
		return {value.Density, value.Friction, value.Elasticity, value.FrictionWeight, value.ElasticityWeight}

	elseif typeString == "Ray" then
		return {value.Origin.X, value.Origin.Y, value.Origin.Z, value.Direction.X, value.Direction.Y, value.Direction.Z}

	elseif typeString == "Rect" then
		return {value.Min.X, value.Min.Y, value.Max.X, value.Max.Y}

	elseif typeString == "Region3" then
		-- FUTURE: support rotated Region3s if/when they become constructable
		return {
			value.CFrame.X, value.CFrame.Y, value.CFrame.Z,
			value.Size.X, value.Size.Y, value.Size.Z
		}

	elseif typeString == "Region3int16" then
		return {value.Min.X, value.Min.Y, value.Min.Z, value.Max.X, value.Max.Y, value.Max.Z}

	elseif typeString == "UDim" then
		return {value.Scale, value.Offset}

	elseif typeString == "UDim2" then
		return {value.X.Scale, value.X.Offset, value.Y.Scale, value.Y.Offset}

	elseif typeString == "Vector2" then
		return {value.X, value.Y}

	elseif typeString == "Vector2int16" then
		return {value.X, value.Y}

	elseif typeString == "Vector3" then
		return {value.X, value.Y, value.Z}

	elseif typeString == "Vector3int16" then
		return {value.X, value.Y, value.Z}
	else
		return {}
	end
end

return unpackType
-- Define the function to toggle the frames and button position
local function toggleFrames()
	if frame1.Visible == true and apl.Value == true then
		-- If frames are visible, hide them and tween button to closed position
		frame1.Closed.Visible = true
		game:GetService("TweenService"):Create(frame1.Closed, TweenInfo.new(0.2), {BackgroundTransparency = 0}):Play()
		wait(0.2)
		frame1.Visible = false
		sud:Play()
		textButton.Text = ">"
	elseif frame1.Visible == false and apl.Value == true then
		-- If frames are hidden, show them and tween button to open position
		frame1.Visible = true
		game:GetService("TweenService"):Create(frame1.Closed, TweenInfo.new(0.2), {BackgroundTransparency = 1}):Play()
		wait(0.2)
		frame1.Closed.Visible = false
		sud:Play()
		textButton.Text = "<"
	end
end
--[[
	Calls a callback on `andThen` with specific arguments.
]]
function Promise.prototype:andThenCall(callback, ...)
	assert(type(callback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:andThenCall"))
	local length, values = pack(...)
	return self:_andThen(debug.traceback(nil, 2), function()
		return callback(unpack(values, 1, length))
	end)
end
Promise.prototype.AndThenCall = Promise.prototype.andThenCall
Promise.prototype.ThenCall = Promise.prototype.andThenCall
--[[
	A dictionary of primary and secondary colors associated with Item Categories.

	Used to determine the colors a given item's ListItems should have in a ListSelector
--]]

local ItemCategory = require(script.Parent.ItemCategory)
local ColorTheme = require(script.Parent.ColorTheme)

type CategoryColorSchemeType = {
	Primary: Color3,
	Secondary: Color3,
}

type ItemCategoryColorsType = {
	[ItemCategory.EnumType]: CategoryColorSchemeType,
}

local ItemCategoryColor: ItemCategoryColorsType = {
	[ItemCategory.Plants] = {
		Primary = ColorTheme.Green,
		Secondary = ColorTheme.LightGreen,
	},
	[ItemCategory.Seeds] = {
		Primary = ColorTheme.Green,
		Secondary = ColorTheme.LightGreen,
	},
	[ItemCategory.Pots] = {
		Primary = ColorTheme.Orange,
		Secondary = ColorTheme.LightOrange,
	},
	[ItemCategory.Tables] = {
		Primary = ColorTheme.Orange,
		Secondary = ColorTheme.LightOrange,
	},
	[ItemCategory.Wagons] = {
		Primary = ColorTheme.Orange,
		Secondary = ColorTheme.LightOrange,
	},
	[ItemCategory.CoinBundles] = {
		Primary = ColorTheme.Orange,
		Secondary = ColorTheme.LightOrange,
	},
}

return ItemCategoryColor
--local ClickerModule = require(343254562)
--local clickEvent = ClickerModule.RemoteEvent
local interactiveParts = {}
local activationDistance = 12
local flushing = false
local water = script.Parent.Parent.Water
local sound = script.Parent.Parent.ToiletBowl.Sound
sound:Play()
wait(0.65)

			for i, v in pairs(script.Parent.Parent:GetChildren()) do
				if v.Name == "WaterSwirl" then
					v.ParticleEmitter.Transparency = NumberSequence.new(0.9)
					v.ParticleEmitter.Rate = 40
				end
end
			
			for i = 1, 4 do
				water.CFrame = water.CFrame * CFrame.new(0, 0.01, 0)
				wait()
			end
			for i = 1, 22 do
				water.Mesh.Scale = water.Mesh.Scale + Vector3.new(-0.02, 0, -0.02)
				water.CFrame = water.CFrame * CFrame.new(0, -0.015, 0)
				wait()
			end
			
			if script.Parent.Parent.ToiletUsed.Value == true then
				water.BrickColor = BrickColor.new("Pastel yellow")
			end
			
			wait(1.55)
			
			for i = 1, 10 do
				for ii, v in pairs(script.Parent.Parent:GetChildren()) do
					if v.Name == "WaterSwirl" then
						v.ParticleEmitter.Transparency = NumberSequence.new(0.9 + (0.015 * i))
						if i == 10 then
							v.ParticleEmitter.Rate = 0
						end
end
				end
				wait(0.2)
			end
			
			script.Parent.Parent.ToiletUsed.Value = false
			water.BrickColor = BrickColor.new("Fog")
			
			for i = 1, 66 do
				water.Mesh.Scale = water.Mesh.Scale + Vector3.new(0.0066, 0, 0.0066)
				water.CFrame = water.CFrame * CFrame.new(0, 0.00409, 0)
				wait()
			end
			water.CFrame = script.Parent.Parent.WaterResetPos.CFrame
			water.Mesh.Scale = Vector3.new(1,0,1)
			flushing = false
			script.Disabled = true
-- Local private variables and constants
local UNIT_X = Vector3.new(1,0,0)
local UNIT_Y = Vector3.new(0,1,0)
local UNIT_Z = Vector3.new(0,0,1)
local X1_Y0_Z1 = Vector3.new(1,0,1)	--Note: not a unit vector, used for projecting onto XZ plane
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local ZERO_VECTOR2 = Vector2.new(0,0)

local VR_PITCH_FRACTION = 0.25
local tweenAcceleration = math.rad(220)		--Radians/Second^2
local tweenSpeed = math.rad(0)				--Radians/Second
local tweenMaxSpeed = math.rad(250)			--Radians/Second
local TIME_BEFORE_AUTO_ROTATE = 2.0 		--Seconds, used when auto-aligning camera with vehicles
local PORTRAIT_OFFSET = Vector3.new(0,-3,0)

local Util = require(script.Parent:WaitForChild("CameraUtils"))
--[=[
	Same as [RxBrioUtils.where]. Here to keep backwards compatability.

	@deprecated 3.6.0 -- This method does not wrap the resulting value in a Brio, which can sometimes lead to leaks.
	@function filter
	@param predicate (T) -> boolean
	@return (source: Observable<Brio<T>>) -> Observable<Brio<T>>
	@within RxBrioUtils
]=]
RxBrioUtils.filter = RxBrioUtils.where
--Power Rear Wheels
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
	for i,v in pairs(car.Wheels:GetChildren()) do
		if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then
			table.insert(Drive,v)
		end
	end
end
--// [[ INTRO CHANGELOG HOVER ]] \\--
IntroGui.ButtonFrame.ChangelogButton.MouseEnter:Connect(function()
	IntroGui.ButtonFrame.ChangelogButton.GreenDot.Visible = true
end)
IntroGui.ButtonFrame.ChangelogButton.MouseLeave:Connect(function()
	IntroGui.ButtonFrame.ChangelogButton.GreenDot.Visible = false
end)
--[=[
	@param value any
	@return any
	Deserializes the given value.
]=]
function Ser.Deserialize(value: any): any
	if type(value) == "table" then
		local ser = Ser.Classes[value.ClassName]
		if ser then
			value = ser.Deserialize(value)
		end
	end
	return value
end
-- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
--variables
local tiles = script.Parent:GetChildren() --tiles/items inside of the model
local speed = 3 --time between each color change
-- Initialize paint tool
local PaintTool = require(CoreTools:WaitForChild 'Paint')
Core.AssignHotkey('V', Core.Support.Call(Core.EquipTool, PaintTool));
Core.Dock.AddToolButton(Core.Assets.PaintIcon, 'V', PaintTool, 'PaintInfo');
------------------------------------------------------------------
local LockGUI = nil
local AimGUI = nil
local TargetPlayer = nil
local Locked = false
local Targeting = false
--// MAIN CODE

torso = character:WaitForChild("HumanoidRootPart")
joint = character:FindFirstChild("RootJoint", true)
baseC1 = joint.C1

cr = coroutine.resume
cc = coroutine.create

local function getangles()
	local side = torso.CFrame.RightVector:Dot(humanoid.MoveDirection)
	local front = torso.CFrame.LookVector:Dot(humanoid.MoveDirection)
	if frontenabled then
		return side, front*frontmultiplier
	else
		return side, 0
	end
end


humanoid.Died:connect(function()
	script.Disabled = true
end)


game:GetService("RunService").Heartbeat:Connect(function()
	local side, front = getangles()
	joint.C1 = joint.C1:Lerp(baseC1 * CFrame.Angles(math.rad(-front*maxtilt*(humanoid.WalkSpeed/8)),0,math.rad(side*maxtilt*(humanoid.WalkSpeed/16))), stiffness/50)
	
	local ctick = tick()
	if humanoid.MoveDirection.Magnitude > 0 then 

		cr(cc(function()
			local bobx = math.cos(ctick * 7.5) * .25
			local boby = math.abs(math.sin(ctick * 7.5)) * .25        

			local bob = Vector3.new(bobx, boby, 0)

			humanoid.CameraOffset = humanoid.CameraOffset:lerp(bob, .25)
		end))




	else 
		humanoid.CameraOffset = humanoid.CameraOffset * .75
	end
end)
--[[ Script Variables ]]--
while not Players.LocalPlayer do
	wait()
end
local LocalPlayer = Players.LocalPlayer
local CachedHumanoid = nil
local IsFollowStick = true
local ThumbstickFrame = nil
local MoveTouchObject = nil
local OnTouchEnded = nil		-- defined in Create()
local OnTouchMovedCn = nil
local OnTouchEndedCn = nil
--GoPro Hero 4 By RikOne2@InSpare
function OnClick(player)
	if player and (not player.PlayerGui:FindFirstChild("GUI")) then
	script.Parent.GUI:Clone().Parent = player.PlayerGui
		end
end
script.Parent.GUI.Button.V.Value = script.Parent
script.Parent.CD.MouseClick:connect(OnClick)
--Cause: Dried Capacitors Losing Charge
while true do
if script.Parent.Parent.Sound.Sound.PlaybackSpeed > 0.95 then
tone = ((((script.Parent.Parent.Sound.Sound.PlaybackSpeed*4/script.Divisor.Value*script.Multiplier.Value)*script.Speed.Value)*2)/10000)
script.Parent.Parent.Sound.Sound.PlaybackSpeed = script.Parent.Parent.Sound.Sound.PlaybackSpeed + tone
script.Parent.Parent.Sound.Sound2.PlaybackSpeed = script.Parent.Parent.Sound.Sound2.PlaybackSpeed + tone
wait()
else
wait(math.random(5,30))
end
wait()
end
-- Runs whenever a player leaves the game. If that player was actually in the game, removes them from the table and checks for game over state
game.Players.PlayerRemoving:Connect(removeActivePlayer)

AddActivePlayer.OnServerEvent:Connect(addActivePlayer)
RemoveActivePlayer.OnServerEvent:Connect(removeActivePlayer)
--// 스크립트 \\--

while wait(0.2) do
	for _,v in pairs(Main:GetChildren()) do
		if v:isA("Part") then
			Found = false
			local hitbox = Region3.new(v.Position - (v.Size/2), v.Position + (v.Size/2))
			local Char = Player.Character or Player.CharacterAdded:Wait()
			local list = workspace:FindPartsInRegion3WithWhiteList(hitbox, Char:GetDescendants())
			
			for _, Filter in pairs(list) do
				if Filter:FindFirstAncestor(Player.Name) then
					Found = true
					break
				else
					Found = false
				end
			end
			if Found == true then
				for _,v in pairs(Main:WaitForChild(v.Name.."Music"):GetChildren()) do
					if v:isA("Sound") and v.IsPlaying == false then
						v:Play()
						break
					end
				end
			else
				for _,v in pairs(Main:WaitForChild(v.Name.."Music"):GetChildren()) do
					if v:isA("Sound") then
						v:Stop()
					end
				end
			end
		end
	end
end
-- MOVING PLATFORM SETTINGS - Edit the settings to change how the platform works.

moveDelay = 4 -- The delay (in seconds) for moving between destinations.

topSpeed = 30 -- The maximum speed that the platform can move at.
-- Target finding state
local target = nil
local newTarget = nil
local newTargetDistance = nil
local searchIndex = 0
local timeSearchEnded = 0
local searchRegion = nil
local searchParts = nil
--Loop For Making Rays For The Bullet's Trajectory
for i = 1, 30 do
	--print("Travelling")
	local thisOffset = offset + Vector3.new(0, yOffset*(i-1), 0)
	local travelRay = Ray.new(point1,thisOffset)
	
	acceptable = false
	while not acceptable do
		hit, position = workspace:FindPartOnRayWithIgnoreList(travelRay, ignoreList)
		if hit then
			--print(hit.Name)
			if hit.Name == "FakeTrack" or hit.Name == "Flash" then
				ignoreList[#ignoreList+1] = hit
				--print("Un-Acceptable")
			else
				--print("Acceptable")
				acceptable = true
			end
		else
			--print("Acceptable")
			acceptable = true
		end
	end

	local distance 		= (position - point1).magnitude
	round.Size			= Vector3.new(0.6, distance, 0.6)
	round.CFrame		= CFrame.new(position, point1)
							* CFrame.new(0, 0, -distance/2)
							* CFrame.Angles(math.rad(90),0,0)
	round.Parent		= Workspace
	point1				= point1 + thisOffset
	
	allied = false
	if hit and hit.Parent then --if we hit something
		
		--print("Bullet Hit Something")
			
		if hit.Parent.Parent then --look if what we hit is a tank
			tank = hit.Parent.Parent:findFirstChild("Tank")
			
			if not tank and hit.Parent.Parent.Parent then
				tank = hit.Parent.Parent.Parent:findFirstChild("Tank")
					
				if not tank and hit.Parent.Parent.Parent.Parent then
					local tank = hit.Parent.Parent.Parent.Parent:findFirstChild("Tank")
					
					if not tank and hit.Parent.Parent.Parent.Parent.Parent then
						local tank = hit.Parent.Parent.Parent.Parent.Parent:findFirstChild("Tank")
					end
				end
			end
		end
			
		if tank then --if it is a tank
			--print("Hit a Tank")
			if tank.Value == BrickColor.new("Bright red") then --if we hit an ally
				allied = true
				--print("Tank is an ally")
			end
		end
	
		if not allied then
			round:remove()
			local e = Instance.new("Explosion")
			e.BlastRadius = 3
			e.BlastPressure = 1700
			e.ExplosionType = Enum.ExplosionType.NoCraters
			e.DestroyJointRadiusPercent = 1.3
			e.Position = position
			e.Parent = Workspace
			local impactPos = CFrame.new(point1,point1 + thisOffset)-point1+position
			for angle = 1, 360, 40 do
				ray(angle,1.5, impactPos)
				ray(angle,3, impactPos)
				--wait()
			end
			round:remove()
			break
		elseif hit and allied then
			round:remove()
			break
		end
	end
	wait()
end

if round then
	round:remove()
end

script:remove()
--		playToolAnimation("toolnone", toolTransitionTime, Humanoid)
		return
	end

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

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Humanoid)
		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, Humanoid)
	elseif (pose == "Seated") then
		stopAllAnimations()
		moveSit()
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.1, Humanoid)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
-- Regeneration
function regenHealth()
	if Regening then return end
	Regening = true
	
	while Humanoid.Health < Humanoid.MaxHealth do
		local waiting = wait(1)
		local health = Humanoid.Health
		if health > 0 and health < Humanoid.MaxHealth then
			local newHealthDelta = 0.01 * waiting * Humanoid.MaxHealth
			health = health + newHealthDelta
			Humanoid.Health = math.min(health,Humanoid.MaxHealth)
		end
	end
	
	if Humanoid.Health > Humanoid.MaxHealth then
		Humanoid.Health = Humanoid.MaxHealth
	end
	
	Regening = false
end

Humanoid.HealthChanged:connect(regenHealth)
--DevelopmentStatus

Seagull = script.Parent
RunService = game:GetService("RunService")

Torso = Seagull:WaitForChild("Body")
LeftWing = Seagull:WaitForChild("LeftWing")
RightWing = Seagull:WaitForChild("RightWing")

LeftMotor = Torso:WaitForChild("LeftMotor")
RightMotor = Torso:WaitForChild("RightMotor")
--[=[
	This module provides utility functions for strings
	@class String
]=]

local String = {}
-- / Game Assets / --
local GameAssets = game.ServerStorage.GameAssets
local Tools = GameAssets.Tools
-- slash effect when clicking mouse


local function slash()
	local owner = tool.Parent
	local str = Instance.new("StringValue")
	str.Name = "toolanim"
	str.Value = "Slash"
	str.Parent = tool
end

tool.Activated:Connect(slash)
-----------------
--| Constants |--
-----------------

local GRAVITY_ACCELERATION = workspace.Gravity

local RELOAD_TIME = 3 -- Seconds until tool can be used again
local ROCKET_SPEED = 2 -- Speed of the projectile

local MISSILE_MESH_ID = 'http://www.roblox.com/asset/?id=2251534'
local MISSILE_MESH_SCALE = Vector3.new(0.35, 0.35, 0.25)
local ROCKET_PART_SIZE = Vector3.new(1.2, 1.2, 3.27)
--Give player when buy
player:WaitForChild("BackpackShop").Equipped.Changed:Connect(function()
if character:FindFirstChild("Backpack") then
					character.Backpack:Remove()
					local a = game.ServerStorage.Backpacks[equipped.Value]:Clone()
					a.Name = "Backpack"
					a.Parent = character
			end
		end)
	end)
end)
--Tune
OverheatSpeed = .2 --How fast the car will overheat
CoolingEfficiency = .1 --How fast the car will cool down
RunningTemp = 85 --In degrees

Fan = true --Cooling fan
FanTemp = 100 --At what temperature the cooling fan will activate
FanSpeed = .03
FanVolume = .2

BlowupTemp = 130 --At what temperature the engine will blow up

GUI = true --GUI temperature gauge
--Made by Stickmasterluke

originalgrip=CFrame.new(1, 0, 0, 0, 0.03, 0.02, 0, -0.008, 1, 0, 1, 0.008)	--CFrame.new(0,-1.5,0)*CFrame.Angles(0,math.pi/2,0)
currentgrip=originalgrip

function waitfor(parent,name)
	while true do
		local child=parent:FindFirstChild(name)
		if child~=nil then
			return child
		end
		wait()
	end
end

function spinsword(spintime)
	delay(0,function()
		for i=1, 3 do
			local startspin=tick()
			local endspin=startspin+spintime
			while tick()<endspin do
				script.Parent.Grip=currentgrip*CFrame.Angles(math.pi*2*((tick()-startspin)/spintime),0,0)
				wait()
			end
			script.Parent.Grip=currentgrip
			wait(0.2)
		end
	end)
end
-- In 'ServerScriptService', add this into a script named 'PlayerSetup'
local function onPlayerJoin(player)
	setupPlayerStats(player)
	ParticleController.SetupParticlesPlayer(player)
end
-- ClientRemoteProperty
-- Stephen Leitnick
-- December 20, 2021

local Promise = require(script.Parent.Parent.Parent.Promise)
local Signal = require(script.Parent.Parent.Parent.Signal)
local ClientRemoteSignal = require(script.Parent.ClientRemoteSignal)
local Types = require(script.Parent.Parent.Types)
--[=[
	@param object any -- Object to remove
	Removes the object from the Trove and cleans it up.

	```lua
	local part = Instance.new("Part")
	trove:Add(part)
	trove:Remove(part)
	```
]=]
function Trove:Remove(object: any): boolean
	local objects = self._objects
	for i,obj in ipairs(objects) do
		if obj[1] == object then
			local n = #objects
			objects[i] = objects[n]
			objects[n] = nil
			self:_cleanupObject(obj[1], obj[2])
			return true
		end
	end
	return false
end
-- Placeholder texture can be any roblox asset link
local initialTexture = ""

local RowCount = 5 
local ColCount = 3
local perImageSpriteCount = RowCount * ColCount
local width = 320
local height = 200
local startIndexOffset = 11

local framesInTotal = 3
assert(numImages * RowCount * ColCount >= framesInTotal)

local animPeriod = 0.3 -- period for the whole animation, in seconds
assert(animPeriod > 0)

local curImageIdx = 0
local curSpriteIdx = 0

local fps = framesInTotal / animPeriod
local accumulatedTime = 0

local function AnimateImageSpriteSheet(dt)
	accumulatedTime = math.fmod(accumulatedTime + dt, animPeriod)
	curSpriteIdx = math.floor(accumulatedTime * fps) + startIndexOffset

	local prevImageIndex = curImageIdx
	curImageIdx = math.floor(curSpriteIdx / perImageSpriteCount)
	if prevImageIndex ~= curImageIdx then
		imageInstance.Image = imageAssetIDs[curImageIdx + 1]
	end

	local localSpriteIndex = curSpriteIdx - curImageIdx * perImageSpriteCount
	local row = math.floor(localSpriteIndex / ColCount)
	local col = localSpriteIndex - row * ColCount
	imageInstance.ImageRectOffset = Vector2.new(col * width, row * height)
end

Animator.Connection = nil

Animator.Init = function()
	Animator.Connection = game:GetService("RunService").RenderStepped:Connect(AnimateImageSpriteSheet)
end

Animator.Stop = function()
	if Animator.Connection then
		imageInstance.Image = initialTexture
		Animator.Connection:Disconnect()
	end
end


return Animator