Advertisement
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
- print("Converted To FE Script By PlanetTheo.")
- 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
- --------------------------------------------
- local Plr = owner
- local PChar = Plr.Character
- local Assets = "rbxassetid://"
- local DebounceKey = true
- local AnimHop = Instance.new("Animation", PChar)
- AnimHop.AnimationId = Assets.."129423030"
- local TrackAnim = nil
- local StopIt = false
- local GenerateCharacter = function()
- for i,v in pairs(PChar:GetChildren()) do
- wait(0.1)
- if v.ClassName == "Hat" or v.ClassName == "CharacterMesh" then
- v:Destroy()
- end
- if v.ClassName == "Part" then
- v.BrickColor = BrickColor.Black()
- end
- PChar.Head.BrickColor = BrickColor.White()
- PChar["Body Colors"].HeadColor = BrickColor.White()
- PChar["Body Colors"].LeftArmColor = BrickColor.Black()
- PChar["Body Colors"].LeftLegColor = BrickColor.Black()
- PChar["Body Colors"].RightArmColor = BrickColor.Black()
- PChar["Body Colors"].RightLegColor = BrickColor.Black()
- PChar["Body Colors"].TorsoColor = BrickColor.Black()
- PChar.Head.face.Texture = "http://www.roblox.com/asset/?id=282690375"
- PChar.Humanoid.WalkSpeed = 28
- PChar.Humanoid.MaxHealth = math.huge
- PChar.Humanoid.Health = math.huge
- end
- end
- local MusicFolder = Instance.new("Folder", PChar)
- MusicFolder.Name = "Music"
- local SnoopMusic = Instance.new("Sound", MusicFolder)
- SnoopMusic.SoundId = Assets.."172388329"
- local DogeMusic = Instance.new("Sound", MusicFolder)
- DogeMusic.SoundId = Assets.."150794704"
- wait(0.9)
- GenerateCharacter()
- Mouse.KeyDown:connect(function(key) local key = key:lower()
- if key == "e" then
- if DebounceKey == false then
- return
- end
- DebounceKey = false
- PChar.Humanoid.WalkSpeed = 0
- TrackAnim = PChar.Humanoid:LoadAnimation(AnimHop)
- SnoopMusic:Play()
- for i = SnoopMusic.TimeLength, 1, -1 do
- if StopIt == true then
- break
- end
- print(i)
- wait(1)
- TrackAnim:Play()
- end
- DebounceKey = true
- TrackAnim:Stop()
- PChar.Humanoid.WalkSpeed = 14
- end
- if key == "r" then
- if DebounceKey == false then
- return
- end
- DebounceKey = false
- PChar.Humanoid.WalkSpeed = 0
- TrackAnim = PChar.Humanoid:LoadAnimation(AnimHop)
- DogeMusic:Play()
- DogeMusic.Volume = 10
- for i = 55, 1, -1 do
- if StopIt == true then
- break
- end
- print(i)
- wait(1)
- TrackAnim:Play()
- local location = owner.Character:GetModelCFrame()
- local DogeHats = Instance.new("Part")
- DogeHats.CanCollide = false
- DogeHats.RotVelocity = Vector3.new(math.random()*math.pi,math.random()*math.pi,math.random()*math.pi)
- local mesh = Instance.new("SpecialMesh")
- mesh.TextureId = "rbxassetid://151778895"
- mesh.MeshId = "rbxassetid://151778863"
- mesh.MeshType = "FileMesh"
- mesh.Parent = DogeHats
- mesh.Scale = Vector3.new(math.random()*20,math.random()*20,math.random()*20)
- DogeHats.CFrame = location * CFrame.new(math.random()*500 - 250,math.random(100,200),math.random()*500 - 250)
- DogeHats.Parent = game.Workspace
- end
- DebounceKey = true
- TrackAnim:Stop()
- for i = 10, 1, 0 do
- wait(0.2)
- DogeMusic.Volume = i
- end
- DogeMusic:Stop()
- PChar.Humanoid.WalkSpeed = 14
- end
- if key == "w" or key == "a" or key == "s" or key == "d" then
- StopIt = true
- SnoopMusic:Stop()
- DogeMusic:Stop()
- if TrackAnim == nil then else TrackAnim:Stop() end
- DebounceKey = true
- PChar.Humanoid.WalkSpeed = 14
- wait(2)
- StopIt = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement