Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- function wbtwe(Part0, Part1, C0)
- local weld = Instance.new("Weld", Part0)
- weld.Part0 = Part0
- weld.Part1 = Part1
- weld.C0 = Part1.CFrame:inverse() *Part1.CFrame *C0
- return weld
- end
- function rayCast(Position, Direction, Range, Ignore)
- return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
- end
- hrw = wbtwe(owner.Character.Torso, owner.Character.HumanoidRootPart, CFrame.new(0, 0, 0))
- law = wbtwe(owner.Character["Left Arm"], owner.Character.Torso, CFrame.new(1.45, 0.3, 0.1) *CFrame.Angles(0, 25, 0.3))
- raw = wbtwe(owner.Character["Right Arm"], owner.Character.Torso, CFrame.new(-1, 0, -0.4) *CFrame.Angles(-2.9, 0, 12))
- llw = wbtwe(owner.Character["Left Leg"], owner.Character.Torso, CFrame.new(0.2, 2.4, 0) *CFrame.Angles(0, 25, 0.3))
- rlw = wbtwe(owner.Character["Right Leg"], owner.Character.Torso, CFrame.new(-0.2, 2.4, 0) *CFrame.Angles(0, 0, -0.3))
- hw = wbtwe(owner.Character.Head, owner.Character.Torso, CFrame.new(0, -1.5, 0) *CFrame.Angles(0, 0.4, 0))
- local player = owner
- local char = player.Character
- local song = Instance.new("Sound", char.Head)
- song.SoundId = "rbxassetid://733456981"
- song.Volume = 2
- song.Looped = true
- song.TimePosition = 115.5
- song:Play()
- local txt = Instance.new("BillboardGui", char)
- txt.Adornee = char .Head
- txt.Name = "_status"
- txt.Size = UDim2.new(2, 0, 0.3, 0)
- txt.StudsOffset = Vector3.new(-9, 4, 0)
- local text = Instance.new("TextLabel", txt)
- text.Size = UDim2.new(10, 0, 7, 0)
- text.FontSize = "Size24"
- text.TextScaled = true
- text.TextTransparency = 0
- text.BackgroundTransparency = 1
- text.TextTransparency = 0
- text.TextStrokeTransparency = 0
- text.Font = "Highway"
- text.TextStrokeColor3 = BrickColor.new("Dark orange").Color
- text.TextColor3 = BrickColor.new("Deep orange").Color
- text.Text = "KaRmA"
- textsin = 1
- idle = 1
- run = 1
- animing = true
- deb = false
- color = coroutine.wrap(function()
- while game:GetService("RunService").Stepped:wait() do
- text.TextStrokeColor3 = BrickColor.Random().Color
- text.TextColor3 = BrickColor.Random().Color
- textsin = textsin +1
- text.Rotation = math.sin(textsin) *3
- end
- end)color()
- spin = coroutine.wrap(function()
- while wait() do
- local tc = math.random(1,5)
- if tc == 1 then
- text.Text = "KaRmA"
- end
- if tc == 2 then
- text.Text = "kArMa"
- end
- if tc == 3 then
- text.Text = "KARmA"
- end
- if tc == 4 then
- text.Text = "KaRMA"
- end
- if tc == 5 then
- text.Text = "KarmA"
- end
- end
- end)spin()
- twitch = coroutine.wrap(function()
- while game:GetService("RunService").Stepped:wait() do
- if animing == true then
- hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.5, 0) *CFrame.Angles(math.rad(math.random(-15, 15)), 0.4, math.rad(math.random(5, 15))), 0.1)
- end
- end
- end)twitch()
- anim = coroutine.wrap(function()
- while game:GetService("RunService").Stepped:wait() do
- if animing == true then
- if char.HumanoidRootPart.Velocity.Magnitude < 1 then
- idle = idle +0.1
- law.C0=law.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(1.45, 0, 0.1) *CFrame.Angles(0, 25, math.sin(idle) *0.2), 0.1)
- end
- if char.HumanoidRootPart.Velocity.Magnitude > 1 then
- hitfloor, posfloor = rayCast(owner.Character.HumanoidRootPart.Position, CFrame.new(owner.Character.HumanoidRootPart.Position, owner.Character.HumanoidRootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4 * 1, owner.Character)
- if hitfloor then
- run = run +0.1
- law.C0=law.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(1.45, 0.1, math.sin(run) *0.8) *CFrame.Angles(math.sin(-run) *0.8, 25, 0), 0.1)
- llw.C0=llw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0.45, 2.4, math.sin(run) *0.1) *CFrame.Angles(math.sin(-run) *0.8, 25, 0), 0.1)
- rlw.C0=rlw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(-0.4, 2.4, math.sin(-run) *0.1) *CFrame.Angles(math.sin(run) *0.8, 25, 0), 0.1)
- end
- if hitfloor == nil then
- end
- end
- end
- end
- end)anim()
Add Comment
Please, Sign In to add comment