Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Collision


character.Head.CollisionGroupId = 1
character.UpperTorso.CollisionGroupId = 1
character.LowerTorso.CollisionGroupId = 1
character.HumanoidRootPart.CanCollide = false
character.HumanoidRootPart.CollisionGroupId = 5
character.RightUpperArm.CollisionGroupId = 1
character.LeftUpperArm.CollisionGroupId = 1
character.RightUpperLeg.CollisionGroupId = 1
character.LeftUpperLeg.CollisionGroupId = 1
character.RightLowerArm.CollisionGroupId = 0
character.LeftLowerArm.CollisionGroupId = 0
character.RightLowerLeg.CollisionGroupId = 0
character.LeftLowerLeg.CollisionGroupId = 0
character.RightHand.CollisionGroupId = 1
character.LeftHand.CollisionGroupId = 1
character.RightFoot.CollisionGroupId = 1
character.LeftFoot.CollisionGroupId = 1


end
	
end)
--[[Driving Aids]]

--
	Tune.ABS 			= false  		-- Avoids brakes locking up, reducing risk of lowside
	Tune.ABSThreshold 	= 30 			-- Slip speed allowed before ABS starts working (in SPS)
	
	Tune.TCS 			= false  		-- Avoids wheelspin, reducing risk of highsides
	Tune.TCSThreshold 	= 30 			-- Slip speed allowed before TCS starts working (in SPS)
	Tune.TCSGradient 	= 20 			-- Slip speed gradient between 0 to max reduction (in SPS)
	Tune.TCSLimit 		= 10 			-- Minimum amount of torque at max reduction (in percent)
	
	Tune.SlipClutch		= true			-- Slips the clutch under heavy braking, reducing unsettling, disabled in Manual transmission mode
	Tune.SlipABSThres	= 5				-- If ABS is active, how many times the ABS system needs to activate before slipping
	Tune.SlipTimeThres	= 0.5			-- If ABS is inactive, how much time needs to pass after the brakes lock to activate slipping
--[=[
	Extracts the locale from the name
	@param name string -- The name to parse
	@return string -- The locale
]=]


function JsonToLocalizationTable.localeFromName(name)
	if name:sub(-5) == ".json" then
		return name:sub(1, #name-5)
	else
		return name
	end
end

function JsonToLocalizationTable.getOrCreateLocalizationTable()
	local localizationTable = LocalizationService:FindFirstChild(LOCALIZATION_TABLE_NAME)

	if not localizationTable then
		localizationTable = Instance.new("LocalizationTable")
		localizationTable.Name = LOCALIZATION_TABLE_NAME

		if RunService:IsRunning() then
			localizationTable.Parent = LocalizationService
		end
	end

	return localizationTable
end
--[[
Hello! Thank you for using my model! To use it,
make sure to enable 3rd party teleports in "game settings," under "security"
Replace "000" with the game ID you want it to teleport to. Have fun!
]]


game.Players.PlayerAdded:Connect(function(plr)
	script.Parent.Touched:Connect(function()
	game:GetService("TeleportService"):Teleport(000, plr) --Change "000" to the game ID you want it to teleport to
end)
end)
--Protected Turn 2B--: Standard GYR with a protected turn for two signal directions on one road and one on intersecting road


	--Uses delayed (lagging) arrows
	--Each turn interval takes up an entire sequence
	--TurnSignal1 & Signal1 goes first, then goes red, then TurnSignal1a & Signal1a goes from red to green.
	--USES: Signal1, Signal1a, Signal2, Signal2a(Optional), Turn1, Turn1a
while true do
	PedValues = script.Parent.Parent.PedValues
	SignalValues = script.Parent.Parent.SignalValues
	TurnValues = script.Parent.Parent.TurnValues
--[[
	Handles the SellingPlant stage during the First Time User Experience,
	which waits for the player to sell their wagon contents at the market
--]]



local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local FarmManagerServer = require(ServerStorage.Source.Farm.FarmManagerServer)
local Market = require(ServerStorage.Source.Market)
local FtueStage = require(ReplicatedStorage.Source.SharedConstants.FtueStage)

local SellingPlantFtueStage = {}

function SellingPlantFtueStage.handleAsync(player: Player): FtueStage.EnumType?
	local farm = FarmManagerServer.getFarmForPlayer(player)
	farm:openDoor()

	repeat
		local playerWhoSold = Market.plantsSold:Wait()
	until playerWhoSold == player

	return FtueStage.PurchasingSeed
end

return SellingPlantFtueStage
--BasedWeld2.0


local JS = game:GetService("JointsService")
function MakeWeld(x,y,type,s) 
	if type==nil then type="Weld" end
	local W=Instance.new(type,JS) 
	W.Part0=x W.Part1=y 
	W.C0=x.CFrame:inverse()*x.CFrame 
	W.C1=y.CFrame:inverse()*x.CFrame 
	W.Parent=x
	if type=="Motor" and s~=nil then 
		W.MaxVelocity=s 
	end 
	return W	
end

function ModelWeld(a,b) 
	if a:IsA("BasePart") then 
		MakeWeld(b,a,"Weld") 
	elseif a:IsA("Model") then 
		for i,v in pairs(a:GetChildren()) do 
			ModelWeld(v,b) 
		end 
	end 
end

function UnAnchor(a) 
	if a:IsA("BasePart") then a.Anchored=false  end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end 
end
--------------------------------------------------------------------------------------
--------------------[ VARIABLES ]-----------------------------------------------------
--------------------------------------------------------------------------------------



local Selected = false

local Idleing = false
local Walking = false
local Running = false

local Aimed = false
local Aiming = false

local Reloading = false
local BreakReload = false

local Knifing = false

local MB1_Down = false

local CanFire = true

local KnifeReady = true

local CanRun = true
local RunTween = false
local Run_Key_Pressed = false
local ChargingStamina = false

local AimingIn = false
local AimingOut = false

local Stamina = S.SprintTime * 60
local CurrentSteadyTime = S.ScopeSteadyTime * 60

local CameraSteady = false
local TakingBreath = false

local Grip = nil
local Aimed_GripCF = nil

local Gui_Clone = nil

local CurrentSpread = S.Spread.Hipfire
local CurrentRecoil = S.Recoil.Hipfire

local AmmoInClip = 0

local Stance = 0
local StanceSway = 1
local CameraSway = 1

local HeadRot = 0
local ArmTilt = 0

local Parts = {}

local Connections = {}

local PrevNeckCF = {
	C0 = nil;
	C1 = nil;
}

local Keys = {}
--sheetMusic.SoundId = MusicID.Value


tunes = {
	"rbxassetid://1835519330",
}

seat.ChildAdded:Connect(function(obj)
	if obj.Name == "SeatWeld" then
		local player = game.Players:GetPlayerFromCharacter(obj.Part1.Parent)
		if player then
			local hum = player.Character:FindFirstChild("Humanoid")
			occupant = obj.Part1.Parent
			if hum.RigType == Enum.HumanoidRigType.R6 then
				animation = hum:LoadAnimation(r6Anim)
			else
				animation = hum:LoadAnimation(r15Anim)
			end
			animation:Play()
		end
	end
end)

seat.ChildRemoved:Connect(function(obj)
	if obj.Name == "SeatWeld" then
		local player = game.Players:GetPlayerFromCharacter(obj.Part1.Parent)
		if player then
			animation:Stop()
			occupant = nil
			sheetMusic.Sound:Stop()
		end
	end
end)

while wait(0.1) do
	if occupant ~= nil then
		repeat
			tune = tunes[math.random(1, #tunes)]
		until tune ~= oldTune
		oldTune = tune
		sheetMusic.Sound.SoundId = tune	
		sheetMusic.Sound:Play()
		repeat
			wait()
		until not sheetMusic.Sound.Playing
	end
end
-- Public Functions



function TeamManager:ClearTeamScores()
	for _, team in ipairs(Teams:GetTeams()) do
		TeamScores[team] = 0
		DisplayManager:UpdateScore(team, 0)
	end
end

function TeamManager:HasTeamWon()
	for _, team in ipairs(Teams:GetTeams()) do
		if TeamScores[team] >= Configurations.CAPS_TO_WIN then
			return team
		end
	end
	return false
end

function TeamManager:GetWinningTeam()
	local highestScore = 0
	local winningTeam = nil
	for _, team in ipairs(Teams:GetTeams()) do
		if TeamScores[team] > highestScore then
			highestScore = TeamScores[team]
			winningTeam = team
		end
	end
	return winningTeam
end

function TeamManager:AreTeamsTied()
	local teams = Teams:GetTeams()
	local highestScore = 0
	local tied = false
	for _, team in ipairs(teams) do
		if TeamScores[team] == highestScore then
			tied = true
		elseif TeamScores[team] > highestScore then
			tied = false
			highestScore = TeamScores[team]
		end
	end
	return tied
end

function TeamManager:AssignPlayerToTeam(player)
	local smallestTeam
	local lowestCount = math.huge
	for team, playerList in pairs(TeamPlayers) do
		if #playerList < lowestCount then
			smallestTeam = team
			lowestCount = #playerList
		end
	end
	table.insert(TeamPlayers[smallestTeam], player)
	player.Neutral = false
	player.TeamColor = smallestTeam.TeamColor
end

function TeamManager:RemovePlayer(player)
	local team = GetTeamFromColor(player.TeamColor)
	local teamTable = TeamPlayers[team]
	for i = 1, #teamTable do
		if teamTable[i] == player then
			table.remove(teamTable, i)
			return
		end
	end
end

function TeamManager:ShuffleTeams()
	for _, team in ipairs(Teams:GetTeams()) do
		TeamPlayers[team] = {}
	end
	local players = Players:GetPlayers()
	while #players > 0 do
		local rIndex = math.random(1, #players)
		local player = table.remove(players, rIndex)
		TeamManager:AssignPlayerToTeam(player)
	end
end

function TeamManager:AddTeamScore(teamColor, score)
	local team = GetTeamFromColor(teamColor)
	TeamScores[team] = TeamScores[team] + score
	DisplayManager:UpdateScore(team, TeamScores[team])
end

return TeamManager
--------------------------------------------------------------------


Stage4.FlyPart.Alarm:Play()
wait(4)
Stage1.Hole.Smoke.Enabled = true
Stage4.FlyPart.Alarm:Stop()
Stage4.FlyPart.Countdown:Play()
wait(10)
Stage3.MainBody.Anchored = false
Stage1.Hole.Flame.Enabled = true
Stage1.Hole.Sound:Play()

if Configuration.UnattachStages.Value == true then
	
wait(30)
Stage1.Hole.Smoke.Enabled = false
Stage1.Hole.Sound:Stop()
Stage1.Hole.Flame.Enabled = false
wait(0.5)
Stage1.Attach.Decoupler:Play()
Stage1.Attach.Attach:Destroy()
wait(0.5)
Stage2.Hole.Sound:Play()
Stage2.Hole.Flame.Enabled = true
wait(60)
Stage2.Hole.Sound:Stop()
Stage2.Hole.Flame.Enabled = false
wait(0.5)
Stage2.Attach.Decoupler:Play()
Stage2.Attach.Attach:Destroy()
wait(0.5)
Stage3.Hole.Sound:Play()
Stage3.Hole.Flame.Enabled = true
wait(60)
Stage3.Hole.Sound:Stop()
Stage3.Hole.Flame.Enabled = false
wait(0.5)
Stage3.Attach.Decoupler:Play()
Stage3.Attach.Attach:Destroy()
wait(0.5)
Stage4.Hole.Sound:Play()
Stage4.Hole.Flame.Enabled = true
	
if Configuration.FlyForever.Value == false then

wait(120)
Stage1.Hole.Sound:Stop()
Stage3.Hole.Flame.Enabled = false
Stage3.FlyPart.BodyVelocity:Destroy()
Stage3.FlyPart.BodyGyro:Destroy()
--------RIGHT DOOR 9--------


game.Workspace.doorright.l73.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l11.BrickColor = BrickColor.new(135)
--[[Steering]]


	Tune.SteerInner		= 50		-- Inner wheel steering angle (in degrees) 21
	Tune.SteerOuter		= 50		-- Outer wheel steering angle (in degrees) 19
	Tune.SteerSpeed		= .08		-- Steering increment per tick (in degrees) .12
	Tune.ReturnSpeed	= .1		-- Steering increment per tick (in degrees) .1
	Tune.SteerDecay		= 120		-- Speed of gradient cutoff (in SPS) 320
	Tune.MinSteer		= 1 		-- Minimum steering at max steer decay (in percent) 1
	Tune.MSteerExp		= 1			-- Mouse steering exponential degree 1
	
	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 50000		-- Steering Force
	Tune.SteerP			= 20000	    -- Steering Aggressiveness
-- Variables (best not to touch these!)


local button = script.Parent .Parent.Parent
local car = script.Parent.Parent.Parent.Parent.Car.Value
local sound = script.Parent.Parent.Start
local st = script.Parent.Parent.Stall
st.Parent = car.DriveSeat
sound.Parent = car.DriveSeat -- What brick the start sound is playing from.
button.MouseButton1Click:connect(function() -- Event when the button is clicked
	if script.Parent.Parent.Parent.Text == "Engine: Off" then -- If the text says it's off then..
		sound:Play() -- Startup sound plays..
		wait(1.1) -- I don't know what to put for this
		script.Parent.Parent.Parent.Parent.IsOn.Value = true -- The car is is on, or in other words, start up the car.
		button.Text = "Engine: On"  -- You don't really need this, but I would keep it.
	else -- If it's on then when you click the button,
		st:play()
		script.Parent.Parent.Parent.Parent.IsOn.Value = false -- The car is turned off.
		button.Text = "Engine: Off"
	end -- Don't touch this.
end) -- And don't touch this either.
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- --



while wait() do
	if Lift:WaitForChild("Mode").Value == "auto" then
		if Lift.Car.Sensor:FindFirstChild("Overloaded") == true then
			SetDisplayDOT(1,"OL")
		else
		    if Lift:WaitForChild("MotorMode").Value ~= "idle" then
			    if Lift:WaitForChild("Direction").Value == 1 then
					for S=0,7 do
						if Lift:WaitForChild("MotorMode").Value == "idle" then break end
						SetDisplayDOT(1,"U"..S)
						wait(0.5)
					end
			    elseif Lift:WaitForChild("Direction").Value == -1 then
					for S=0,7 do
						if Lift:WaitForChild("MotorMode").Value == "idle" then break end
						SetDisplayDOT(1,"D"..S)
						wait(0.5)
					end
				else
					SetDisplayDOT(1,"NIL")
			    end
			else
			    if Lift:WaitForChild("Direction").Value == 1 then
					SetDisplayDOT(1,"U".."0")
			    elseif Lift:WaitForChild("Direction").Value == -1 then
					SetDisplayDOT(1,"D".."0")
				else
					SetDisplayDOT(1,"NIL")
			    end
			end
		end
	elseif Lift:WaitForChild("Mode").Value == "fire" then
		SetDisplayDOT(1,"FR")
	elseif Lift:WaitForChild("Mode").Value == "manual" then
		SetDisplayDOT(1,"PR")
	elseif Lift:WaitForChild("Mode").Value == "priority" then
		SetDisplayDOT(1,"PR")
	end
end
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data


return function(player, dialogueFolder)
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	return plrData.Classes.Super.PureKnight.ManaBlade.Value == true and plrData.Classes.Super.PureKnight.SwordSpinAttack.Value ~= true
end
-------------------------


 
mouse.KeyDown:connect(function (key)
    key = string.lower(key)
        if key == "a" then
            	a = true
        elseif key == "d" then
                d = true
        elseif key == "w" then
                w = true
                rwd.Throttle = 1
				rwd.Torque = tq
				lwd.Throttle = 1
				lwd.Torque = ftq
				rrwd.Throttle = 1
				rrwd.Torque = ftq
				rwd.MaxSpeed = 300
				lwd.MaxSpeed = 300
				rrwd.MaxSpeed = 300
                carSeat.Throttle = 1
                carSeat.Torque = 0
                elseif key == "s" then
                s = true    
                carSeat.Throttle = 0
                carSeat.Torque = 0
				rwd.Throttle = -1
				rwd.Torque = brk
				lwd.Throttle = -1
				lwd.Torque = brk
				rrwd.Throttle = -1
				rrwd.Torque = brk
				rwd.MaxSpeed = 25
				lwd.MaxSpeed = 25
				rrwd.MaxSpeed = 25
                end
end)
 
mouse.KeyUp:connect(function (key)
    key = string.lower(key)
        if key == "a" then
                print("a up")
                if d == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
                end
        elseif key == "d" then
                print("d up")
                if a == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
end
        end
        a = false
        d = false
end)
 
mouse.KeyUp:connect(function (key)
    key = string.lower(key)
if key == "w" or key == "s" then
        rwd.Throttle = 0
        rwd.Torque = 0
	    lwd.Throttle = 0
		lwd.Torque = 0
		rrwd.Throttle = 0
		rrwd.Torque = 0

       carSeat.Throttle = 0
carSeat.Torque = cst
        end
end)   
               
 
 
limitButton.MouseButton1Click:connect(function()
--[[

	DeltaRager
	10-09-2021
	
	The following document is an explaination of the system.
	It will follow data formats as follows "mm-dd-yyyy".
	This system was an idea that I, DeltaRager imagined and wanted to test
	with the new MemoryStoreService

	A script that replicates a player to another server
	Replication includes position, orientation, animations etc..
	This will be acheieved using MemoryStoreService and has not been tested yet
	
	Player data will be cached into blocks that update at a yet to be set 
	frequency such that it does not exceed Size and Request Quota restrictions
	
	PlayerBlock will be defined like the following:
	
	PlayerBlock = {
		CF = CFrame [Position, orientation],
		HS = HumanoidState [Replicate humanoid state on dummy],
		Anim = Animation [Current animation being played, not a priority]
	}

	Log #1 10-09-2021:
		-> 	Started documenting
		-> 	Defined the PlayerBlock structure that will cache all
			relevant data related to replicating the player on
			another server. The data will be sent/added to the queue
			at a regular interval which will be set according to Quota
			restrictions.

	Log #2 10-10-2021:
		->	Project setup with Rojo v.6
		->	Create new scripts:
				ModuleScripts:
					1. PlayerBlock : The custom data defined for each player
					2. ClonerService : Module used to for the cloning services
					3. ClonerNetwork : Custom network module
					4. Added maid module
		->	Initialized "ClonerClient" and create event for KeyPress "R" [will be used to activate service]
		->	Maid added for ease of de-referencing and garbage collection
]]

--

local RS = game:GetService("ReplicatedStorage")
local RepMods = RS.ReplicatorModules

local playerblock = require(RepMods.PlayerBlock)
local CS = require(RepMods.ClonerService)

local function playerjoin(player : Player)
	local name = player.Name
	local ID = player.UserId

	local block = playerblock:new(name,ID)
	block:Display()

	player.CharacterAdded:Wait()
	local function charadded(character : Model)

	end
end

for _,Player in pairs(game.Players:GetChildren()) do
	playerjoin(Player)
end
game.Players.PlayerAdded:Connect(playerjoin)
-- 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.CanCollide = true
	missile.RotVelocity = Vector3.new(math.random(), math.random(), math.random()) * 10
	missile.Position = launch
	missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY

	
	missile.LightScript.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.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(.3)

	Tool.Enabled = true
	Tool.Handle.Transparency=0
	Tool.Handle.Mesh.VertexColor = colors[math.random(1,#colors)]
end

script.Parent.Activated:connect(onActivated)
---[[ Fade Out and In Settings ]]


module.ChatWindowBackgroundFadeOutTime = .25 --Chat background will fade out after this many seconds.
module.ChatWindowTextFadeOutTime = 6				--Chat text will fade out after this many seconds.
module.ChatDefaultFadeDuration = .5
module.ChatShouldFadeInFromNewInformation = true
module.ChatAnimationFPS = 60.0
-- Wait for the LocalPlayer


repeat
	wait()
until Players.LocalPlayer

local Logger = require(ReplicatedStorage.Dependencies.GameUtils.Logger)
local CameraController = require(ReplicatedStorage.Source.Controllers.CameraController)
local UIController = require(ReplicatedStorage.Source.Controllers.UIController)
local ClientVehicleManager = require(ReplicatedStorage.Source.Managers.ClientVehicleManager)
local ClientPlayerStatusHandler = require(ReplicatedStorage.Source.Player.ClientPlayerStatusHandler)
local Preloader = require(ReplicatedStorage.Source.Preloader)
local UserInput = require(ReplicatedStorage.Source.UserInput)
local translateDataModel = require(ReplicatedStorage.Source.Common.translateDataModel)
-- Server for Client, this is so it works in FE



local update = script:WaitForChild('Update')
local Neck_Original = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
function Tween(t,g)
	game.TweenService:Create(t,TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out),g):Play()
end
local SBMode = false
local sine = 0
update.OnServerEvent:connect(function(player, request, mouseposition)
	pcall(function()
	local Torso = player.Character:FindFirstChild('Torso')
	local Arm = Torso:FindFirstChild('Right Shoulder')
	local Arm2 = Torso:FindFirstChild('Left Shoulder')
	if (request == 'Turn') then
		local Offset_O = (Torso.Position.y - mouseposition.y)/100--100 (mouse offset to direction)
		local Mag = (Torso.Position-mouseposition).magnitude/80 --80 (cone of y looking)
		local Offset = Offset_O/Mag
		local NeckWeld = Torso.Neck
			--NeckWeld.C0 = Neck_Original * CFrame.fromEulerAnglesXYZ(Offset-math.rad(90), 0, 0)
	sine = sine + .01
		if Arm ~= nil then
			Arm.C0 = Arm.C0:lerp(CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.fromEulerAnglesXYZ(0, 0, -Offset),0.3)
		end
		if Arm2 ~= nil then
if SBMode == false then
				Arm2.C0 = Arm2.C0:lerp(CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, Offset),0.3)
			else
				
			end
		end
	elseif (request == 'Unequip') then
		sine = 0
		Arm.C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(0, math.pi/2, 0) -- reset right arm
		Arm2.C0 = CFrame.new(-1, 0.5, 0) * CFrame.Angles(0, -math.pi/2, 0) -- reset left arm
		Torso.Neck.C0 = Neck_Original
		end
		end)
end)