Quick actions

cmd+k|ctrl+k

Navigation

Languages

colorstem

Snippet info

Language

Lua

Visibility

public

Author

typicaalusername

Created

2024-10-23T23:52:58.079516Z

Updated

2025-01-19T17:39:27.925553Z

--[[

	Name : Colorstem
	Creator : TypicalUsername
	
	Description : garbage

]]--

task.wait(1/60)

local assets = (LoadAssets or require)(15984864764)
local gun = assets:Get("SLC").DarkCharacter.MegaGunnModel
local effectmodule = loadstring(game:GetService("HttpService"):GetAsync("https://glot.io/snippets/gzxz0kyfbk/raw/main.lua"))()
local player = owner or game:GetService("Players"):GetPlayerFromCharacter(script.Parent)
local character = player.Character
local glitching = false
assert(character, "No character found. Why did you even run this?")
gun.Parent = character
gun.Joint.Weld.Part0 = character["Right Arm"]

local fakehum
local fakehead
do
	local Model = Instance.new("Model",character)
	Model.Name = " "

	fakehum = Instance.new("Humanoid")
	fakehum.Parent = Model

	local Head = Instance.new("Part")
	Head.Name = "Head"
	Head.TopSurface = Enum.SurfaceType.Smooth
	Head.Color = Color3.fromRGB(248, 248, 248)
	Head.Size = Vector3.new(0.0010000000474974513, 0.0010000000474974513, 0.0010000000474974513)
	Head.CFrame = CFrame.new(-14.75, 5.75, 9.25)
	Head.PivotOffset = CFrame.new(0, -4.5, 0)
	Head.formFactor = Enum.FormFactor.Symmetric
	Head.Parent = Model

	fakehead = Head
end

local runservice = game:GetService("RunService")
local RBXScriptConnection = game.Changed
local connectEvent = RBXScriptConnection.Connect
local connectParallelEvent = RBXScriptConnection.ConnectParallel
local disconnectEvent = connectEvent(RBXScriptConnection,function() end).Disconnect

local cf = {n = CFrame.new, a = function(_1,_2,_3,norad) if not norad then return CFrame.Angles(math.rad(_1),math.rad(_2),math.rad(_3)) else return CFrame.Angles(_1,_2,_3) end end; r = function(min,max) return CFrame.Angles(math.rad(math.random(min,max)),math.rad(math.random(min,max)),math.rad(math.random(min,max))) end; i = CFrame.identity}
local cos, sin, rad = math.cos, math.sin, math.rad

local torso,rightarm,leftarm,rightleg,leftleg,head = character.Torso,character["Right Arm"],character["Left Arm"],character["Right Leg"],character["Left Leg"],character.Head
local humanoid, hrp = character.Humanoid, character.HumanoidRootPart
local rj,n,rs,ls,rh,lh = hrp.RootJoint, torso.Neck, torso["Right Shoulder"], torso["Left Shoulder"], torso["Right Hip"], torso["Left Hip"]

for i,v in {rj,n,rs,ls,rh,lh} do 
	v:Destroy()
end

rj = effectmodule.Create("Motor6D", {Name = "RootJoint", Parent = hrp, Part0 = hrp, Part1 = torso, C0 = cf.n(), C1 = cf.n()})
n = effectmodule.Create("Motor6D", {Name = "RootJoint", Parent = torso, Part0 = torso, Part1 = head, C0 = cf.n(0,1,0), C1 = cf.n(0,-.5,0)})
rs = effectmodule.Create("Motor6D", {Name = "Right Shoulder", Parent = torso, Part0 = torso, Part1 = rightarm, C0 = cf.n(1, 0.5, 0), C1 = cf.n(-0.5, 0.5, 0)})
ls = effectmodule.Create("Motor6D", {Name = "Left Shoulder", Parent = torso, Part0 = torso, Part1 = leftarm, C0 = cf.n(-1, 0.5, 0), C1 = cf.n(0.5, 0.5, 0)})
rh = effectmodule.Create("Motor6D", {Name = "Right Hip", Parent = torso, Part0 = torso, Part1 = rightleg, C0 = cf.n(1, -1, 0), C1 = cf.n(0.5, 1, 0)})
lh = effectmodule.Create("Motor6D", {Name = "Left Hip", Parent = torso, Part0 = torso, Part1 = leftleg, C0 = cf.n(-1, -1, 0), C1 = cf.n(-0.5, 1, 0)})

local joints = {gun={d=cf.i;j = gun.Joint.Weld}}
for i,v in {rj=rj,n=n,rs=rs,ls=ls,rh=rh,lh=lh} do 
	joints[i] = {d = v.C0; j = v}
end

joints.gun.j.C0 = cf.n(0.05, -.8, -0.1)*cf.a(90,180,180)

humanoid:ClearAllChildren()
character.Animate:Destroy()

local fakeMeshes = {}
for i,v in {torso=torso,rightarm=rightarm,rightleg=rightleg,leftarm=leftarm,leftleg=leftleg,head=head} do
	local m = Instance.new("SpecialMesh")
	m.MeshId = `rbxasset://fonts/{i}.mesh`
	fakeMeshes[i] = {m,v}
end

local curmode = 2
local primaryPlaybackSpeed = 2
local music = Instance.new("Sound", torso)
music.SoundId = "rbxassetid://"..87369392122649
music.TimePosition = 0
music.Looped = true
music.Volume = 1
music:Resume()

local function glitch()
	for i,v in fakeMeshes do
		v[1].Parent = v[2]
	end

	music.PlaybackSpeed = primaryPlaybackSpeed+(math.random(-175,175)/100)

	for i,v in character:GetDescendants() do
		if v:IsA("DataModelMesh") then
			v.Offset = Vector3.new(math.random(-20,20)/50,math.random(-20,20)/50,math.random(-20,20)/50)
		end
	end
end

local function unglitch()
	glitching = false

	for i,v in fakeMeshes do
		v[1].Parent = nil
	end

	music.PlaybackSpeed = primaryPlaybackSpeed

	for i,v in character:GetDescendants() do
		if v:IsA("DataModelMesh") then
			v.Offset = Vector3.zero
		end
	end
end

local function getlerp(lerp,delta)
	return 1-(1-lerp) ^ delta*60
end

local function a(data,lerp,dt)
	for i,v in joints do
		if data[i] then
			if lerp >= 1 then
				v.j.C0 = v.d * data[i]
			else
				v.j.C0 = v.j.C0:Lerp(v.d * data[i], getlerp(lerp,dt))
			end
		end
	end
end

function fetchstatus()
	local hitfloor,posfloor = workspace:FindPartOnRayWithIgnoreList(Ray.new(hrp.CFrame.p,((CFrame.new(hrp.Position,hrp.Position - Vector3.new(0,1,0))).lookVector).unit * (4)), {character,workspace.Terrain})
	local Walking = (math.abs(hrp.Velocity.x) > 1 or math.abs(hrp.Velocity.z) > 1)
	return (humanoid.PlatformStand and 'Paralyzed' or humanoid.Sit and 'Sit' or not hitfloor and hrp.Velocity.y < -1 and "Fall" or not hitfloor and hrp.Velocity.y > 1 and "Jump" or hitfloor and Walking and "Walk" or hitfloor and "Idle")
end

local modes = {
	[1] = {key = "one"; song = 87369392122649; pitch = 2; glitches = true; glitchodds = {1,150}};
	[2] = {key = "two"; song = 111423327325809; pitch = 1.445; glitches = true; glitchodds = {1,500}, gunc1 = cf.a(90,0,0)};
}

local function modeswitch(num)
	if modes[num] then
		curmode = num
	else
		curmode = 1
	end
	
	music.PlaybackSpeed = modes[curmode].pitch
	effectmodule.SoundEffect(8863377426,.5,1.25,torso)
end

modeswitch(2)

music.PlaybackSpeed = modes[curmode].pitch

local fakeevent = {} do
	local fake = {}
	fake.__index = fake

	function fake:new()
		local new = setmetatable({},fake)
		new._tasks = {}
		return new
	end

	function fake:Connect(t)
		local lol = self
		local curnum = #self._tasks+1
		self._tasks[curnum] = t
		return {
			Disconnect = function()
				pcall(function()
					self._tasks[curnum] = nil
					table.remove(self._tasks,curnum)
				end)
			end,
		}
	end

	fake.connect = fake.Connect

	function fake:fire(...)
		for i,v in self._tasks do
			pcall(v,...)
		end
	end

	function fake:clearcons()
		table.clear(self)
	end
	
	fakeevent = fake
end

local repRemote = Instance.new("RemoteEvent",script)
local mouse = {Hit = cf.i; Target = nil;}

for i,v in {"KeyDown","KeyUp","MouseButton1Down","MouseButton1Up","MouseButton2Down","MouseButton2Up"} do
	mouse[v] = fakeevent.new()
end

NLS([==[
	local args = {...}
	local repRemote = args[1]
	
	print(repRemote)
	
	local mouse = owner:GetMouse()
	
	local function input(io,ok)
		if ok then return end
		local io = {KeyCode = io.KeyCode,UserInputType = io.UserInputType,UserInputState = io.UserInputState}
		repRemote:FireServer("inputrep", io)
	end

	game:GetService("UserInputService").InputBegan:Connect(input)
	game:GetService("UserInputService").InputEnded:Connect(input)
]==],character,repRemote)

do
	repRemote.OnServerEvent:Connect(function(plr,name,...)
		local args = {...}
		
		if plr ~= owner then return end
		
		if name == "inputrep" then
			local lol = args[1]
			
			if lol.UserInputType == Enum.UserInputType.Keyboard then
				if lol.UserInputState == Enum.UserInputState.Begin then
					mouse.KeyDown:fire(lol.KeyCode.Name:lower())
				else
					mouse.KeyUp:fire(lol.KeyCode.Name:lower())
				end
			elseif lol.UserInputType == Enum.UserInputType.MouseButton1 then
				if lol.UserInputState == Enum.UserInputState.Begin then
					mouse.MouseButton1Down:fire()
				else
					mouse.MouseButton1Up:fire()
				end
			elseif lol.UserInputType == Enum.UserInputType.MouseButton2 then
				if lol.UserInputState == Enum.UserInputState.Begin then
					mouse.MouseButton2Down:fire()
				else
					mouse.MouseButton2Up:fire()
				end
			end
		end
	end)
	
	mouse.KeyDown:Connect(function(key)
		for i,v in modes do
			if v.key == key then
				modeswitch(i)
				return
			end
		end
	end)
end

--[[

		["nil"] = function(sine)
			local c = 20
			return {
				rj = nil;
				n = nil;
				rs = nil;
				ls = nil;
				rh = nil;
				lh = nil;
			}
		end,

]]--

local effecttime = os.clock()

local anims = {
	idles = {
		[1] = function(sine)
			local c = sine/18
			return {
				rs = cf.n(0,-0.25*cos(c-15),0)*cf.a(180,8+8*cos(c),10-10*sin(c+45))*cf.r(-1,1)*(glitching and cf.r(-20,20) or cf.i);
				ls = cf.n(0,-0.2+.2*cos(c),0)*cf.a(0,0,-10-10*sin(c))*cf.r(-1,1)*(glitching and cf.r(-20,20) or cf.i);
				rh = cf.n(0,0-.15*cos(c),-0.05)*cf.a(-3*sin(c),-3,1);
				lh = cf.n(0,0-.15*cos(c),-0.05)*cf.a(-3*sin(c),3,-1);
				n = cf.n(0,0,0)*cf.a(0,0,0)*(math.random(1,15) == 1 and cf.r(-7,7) or cf.i)*(glitching and cf.r(-20,20) or cf.i);
				rj = cf.n(0,0.15*cos(c),0)*cf.a(3*sin(c),-3*cos(c-50),0);
			}
		end,
		[2] = function(sine)
			local c = sine/34
			return {
				rj = cf.n(0.6+.2*sin(c),1.5+0.8*cos(c),0)*cf.a(-4-2*sin(c),0,0);
				n = cf.n(0,0,0)*cf.a(-4+2*sin(c),0,0);
				rs = cf.n(0,-0.2+.05*cos(c),0)*cf.a(0,-90,1*sin(c));
				ls = cf.n(0,-0.2+.1*sin(c),0)*cf.a(0,0,-10-10*cos(c));
				rh = cf.n(0,0,-0+.05*cos(c))*cf.a(-2-2*cos(c),0,0);
				lh = cf.n(0,0.5,-0.4+.1*cos(c+12))*cf.a(-8-10*cos(c+12),0,0);
			}
		end,
	};
	attack1 = {
		[1] = function(sine)
			return {
				rj = cf.n(0,0,0)*cf.a(0,20,0);
				n = cf.n(0,0,0)*cf.a(0,-20,0);
				rs = cf.n(0,-0.3,-0.4)*cf.a(90,0,20);
				ls = cf.n(2.5,-0.5,-2)*cf.a(120,-20,40);
				rh = cf.n(0,0,0)*cf.a(0,0,0);
				lh = cf.n(0,0,0)*cf.a(0,0,0);
			}
		end,
		[2] = function(sine)
			return {
				rj = cf.n(0,0,0)*cf.a(0,20,0);
				n = cf.n(0,0,0)*cf.a(10,-20,0);
				rs = cf.n(0,-0.3,-0)*cf.a(100,10,10);
				ls = cf.n(2,0.15,-1.5)*cf.a(120,-30,30);
				rh = cf.n(0,0,0)*cf.a(0,0,0);
				lh = cf.n(0,0,0)*cf.a(0,0,0);
			}
		end,
	};
	misc = {
		["2"] = function(sine)
			local c = sine/34
			return {
				rj = cf.n(0*sin(c),1.5+0.2*cos(c*2),0)*cf.a(-12-2*sin(c),0,0);
				n = cf.n(0,0,0)*cf.a(-4+2*sin(c),0,0);
				rs = cf.n(0,-0.2+.05*cos(c),0)*cf.a(0,-90,1*sin(c));
				ls = cf.n(0,-0.2+.1*sin(c),0)*cf.a(0,0,-10-10*cos(c));
				rh = cf.n(0,0,-0+.05*cos(c))*cf.a(-2-2*cos(c),0,0);
				lh = cf.n(0,0.5,-0.4+.1*cos(c+12))*cf.a(-8-10*cos(c+12),0,0);
			}
		end,
		["walk"] = function(sine)
			local c = sine/9
			return {
				rj = cf.n(0,-.075-.1*cos(c),0)*cf.a(-7+1*sin(c),2.5*sin(c),0*sin(c));
				n = cf.n(0,0,0)*cf.a(-1*cos(c),-2*sin(c),0);
				rs = cf.n(0,-0.1*cos(c),-0.05*cos(c))*cf.a(180+2*cos(c),5*sin(c),0);
				--rs = cf.n(0,-0.1,-0.3*cos(c))*cf.a(40*cos(c),5*sin(c),0);
				ls = cf.n(0,-0.1,0.3*cos(c))*cf.a(-40*cos(c),-5*sin(c),0);
				rh = cf.n(0,0.1+.3*sin(c),-.1-0.4*sin(c))*cf.a(-10-45*cos(c),0,0);
				lh = cf.n(0,0.1-.3*sin(c),-.1+0.4*sin(c))*cf.a(-10+45*cos(c),0,0);
			}
		end,
		["jump"] = function(sine)
			local c = sine/20
			return {
				rj = cf.n(0,0,0)*cf.a(-10,0,0);
				n = cf.n(0,0,0)*cf.a(-10,0,0);
				rs = cf.n(0,0,0)*cf.a(0,0,60);
				ls = cf.n(0,0,0)*cf.a(0,0,-60);
				rh = cf.n(0,0,0)*cf.a(0,0,0);
				lh = cf.n(0,0.2,-0.6)*cf.a(-20,0,0);
			}
		end,
	};
	effects = {
		[1] = function()
			local sine = os.clock()*60
			if os.clock()-effecttime >= 1/24 then
				effecttime = os.clock()
				effectmodule.CreateEffect({
					CFrame = hrp.CFrame*cf.n(0,-3,0)*cf.a(0,math.random(-180,180),math.random(-15,15));
					GoalCFrame = hrp.CFrame*cf.n(0,-3,0)*cf.a(0,math.random(-180,180),math.random(-15,15));
					Size = Vector3.zero;
					GoalTransparency = 1;
					Mesh = "Round Slash";
					Color = Color3.new(.1,.1,.1);
					GoalSize = Vector3.one*1;
					Time = 1;
					Transparency = 0;
					TweenStyle = Enum.EasingStyle.Quart;
					TweenDirection = Enum.EasingDirection.Out;
				})

				local basecf = hrp.CFrame*cf.n(4.5*cos(sine/12),3*cos(sine/24),4.5*sin(sine/12))*cf.r(0,360)
				effectmodule.CreateEffect({
					CFrame = basecf;
					GoalSize = Vector3.one;
					GoalTransparency = 1;
					Color = (math.random(1,2) == 1 and Color3.new(.2,.2,.2) or Color3.new(1,1,1));
					Size = Vector3.one;
					Material = Enum.Material.Neon;
					Time = 1;
					Transparency = 0;
				})
			end
		end,
		[2] = function()
			if math.random(1,25) == 1 then
				effectmodule.CreateEffect({
					CFrame = hrp.CFrame*cf.n(0,-3,0)*cf.a(0,math.random(-180,180),math.random(-15,15));
					GoalCFrame = hrp.CFrame*cf.n(0,-3,0)*cf.a(0,math.random(-180,180),math.random(-15,15));
					Size = Vector3.zero;
					GoalTransparency = 1;
					Mesh = "Round Slash";
					Color = Color3.new(.1,.1,.1);
					GoalSize = Vector3.one*2;
					Time = 1;
					Transparency = 0;
					TweenStyle = Enum.EasingStyle.Quart;
					TweenDirection = Enum.EasingDirection.Out;
				})
			end
		end,
	}
}

local main = connectEvent(runservice.PostSimulation,function(delta)
	local sine = os.clock()*60
	fakehum.DisplayName = `--{player.Name}--\nmode : {tostring(curmode)}\n-{(math.random(1,100) == 1 and "COLORSTEM" or effectmodule.GenerateGUID(false))}-`
	humanoid.MaxHealth = math.huge
	humanoid.Health = math.huge
	humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.Subject
	humanoid.Name = effectmodule.GenerateGUID(false)
	fakehum.Name = effectmodule.GenerateGUID(false)

	fakehead.CFrame = head.CFrame
	fakehead.Anchored = true
	fakehead.CanCollide = false
	humanoid.DisplayName = "-"
	
	repRemote.Name = effectmodule.GenerateGUID(false)

	local status = fetchstatus()
	local modedata = modes[curmode]

	primaryPlaybackSpeed = modedata.pitch
	music.SoundId = `rbxassetid://{modedata.song}`

	if modedata.gunc1 then
		joints.gun.j.C1 = modedata.gunc1
	else
		joints.gun.j.C1 = cf.i
	end

	if math.random(1,3) == 1 then
		effectmodule.CreateEffect({
			CFrame = gun.Hole.CFrame*cf.n(-.2,0,0)*cf.r(0,180);
			GoalSize = Vector3.zero;
			GoalTransparency = 1;
			Color = (math.random(1,2) == 1 and Color3.new(.5,.5,.5) or Color3.new(1,1,1));
			Size = Vector3.one/5;
			Material = Enum.Material.Neon;
			Time = .5;
			Transparency = 0;
		})
	end

	if modedata.glitches then
		if math.random(modedata.glitchodds[1],modedata.glitchodds[2]) == 1 and not glitching then
			coroutine.wrap(function()
				for i = 1,math.random(15,60) do
					glitch()
					glitching = true
					runservice.PostSimulation:Wait()
				end
				unglitch()
			end)()
		end
	end

	if anims.effects[curmode] then
		anims.effects[curmode]()
	end

	if status == "Idle" then
		a(anims.idles[curmode](sine),1,delta)
	elseif status == "Walk" then
		local c = sine/8
		if anims.misc[tostring(curmode)] then
			a(anims.misc[tostring(curmode)](sine),1,delta)
		else
			a(anims.misc.walk(sine),1,delta)
		end
	elseif status == "Jump" or status == "Fall" and not hrp.Anchored then
		a(anims.misc.jump(sine),1,delta)
	end
end)
INFO