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("FE Compatibility code by Mokiros")
- 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
- plr = owner
- char = plr.Character
- leftleg = char["Left Leg"]
- rightleg = char["Right Leg"]
- rightarm = char["Right Arm"]
- leftarm = char["Left Arm"]
- torso = char["Torso"]
- head = char["Head"]
- --Head--
- pethead = Instance.new("Part")
- pethead.Parent = char
- pethead.Size = Vector3.new(1, 0.5, 0.5)
- pethead.Anchored = true
- pethead.CanCollide = false
- pethead.BrickColor = BrickColor.new("Bright yellow")
- face = Instance.new("Decal")
- face.Face = "Front"
- face.Texture = "rbxassetid://242438967"
- headmesh = Instance.new("SpecialMesh")
- headmesh.Parent = pethead
- headmesh.Scale = Vector3.new(1.25, 1.25, 1.25)
- --Torso--
- pettorso = Instance.new("Part")
- pettorso.Parent = char
- pettorso.Size = Vector3.new(1, 1, 0.5)
- pettorso.Anchored = true
- pettorso.CanCollide = false
- pettorso.BrickColor = BrickColor.new("Bright blue")
- --Left Arm--
- petleftarm = Instance.new("Part")
- petleftarm = Instance.new("Part")
- petleftarm.Parent = char
- petleftarm.Size = Vector3.new(0.5, 1, 0.5)
- petleftarm.Anchored = true
- petleftarm.CanCollide = false
- petleftarm.BrickColor = BrickColor.new("Bright yellow")
- --Right Arm--
- petrightarm = Instance.new("Part")
- petrightarm.Parent = char
- petrightarm.Size = Vector3.new(0.5, 1, 0.5)
- petrightarm.Anchored = true
- petrightarm.CanCollide = false
- petrightarm.BrickColor = BrickColor.new("Bright yellow")
- --Right Leg--
- petrightleg = Instance.new("Part")
- petrightleg.Parent = char
- petrightleg.Size = Vector3.new(0.5, 1, 0.5)
- petrightleg.Anchored = true
- petrightleg.CanCollide = false
- petrightleg.BrickColor = BrickColor.new("Br. yellowish green")
- --Left Leg--
- petleftleg = Instance.new("Part")
- petleftleg.Parent = char
- petleftleg.Size = Vector3.new(0.5, 1, 0.5)
- petleftleg.Anchored = true
- petleftleg.CanCollide = false
- petleftleg.BrickColor = BrickColor.new("Br. yellowish green")
- --Music--
- sound = Instance.new("Sound")
- sound.Parent = pethead
- sound.Playing = true
- sound.Looped = true
- sound.SoundId = "rbxassetid://2888228232"
- sound.Volume = 2
- --GUI--
- local ScreenGui = Instance.new("ScreenGui")
- local TextButton = Instance.new("TextButton")
- ScreenGui.Parent = plr:WaitForChild("PlayerGui")
- ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- TextButton.Parent = ScreenGui
- TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton.Position = UDim2.new(0, 0, 0.905303001, 0)
- TextButton.Size = UDim2.new(0, 200, 0, 50)
- TextButton.Font = Enum.Font.SourceSans
- TextButton.Text = "noob talk"
- TextButton.TextColor3 = Color3.new(0, 0, 0)
- TextButton.TextScaled = true
- TextButton.TextSize = 14
- TextButton.TextWrapped = true
- TextButton.MouseButton1Click:Connect(function()
- local sur = Instance.new("BillboardGui", char.Head)
- sur.Name = "Billboard"
- sur.Adornee = pethead
- sur.Size = UDim2.new(10, 0, 5, 0)
- sur.StudsOffset = Vector3.new(0, 5, 0)
- local text = Instance.new("TextLabel", sur)
- text.Text = "oof rave"
- text.Size = UDim2.new(1, 0, 1, 0)
- text.TextScaled = true
- text.BackgroundTransparency = 1
- text.Font = Enum.Font.SourceSansLight
- text.TextColor3 = Color3.new(255, 0, 0)
- text.TextStrokeTransparency = 0
- text.TextStrokeColor3 = Color3.new(0, 0, 255)
- wait(5)
- sur:Destroy()
- end)
- while true do
- pethead.Position = head.Position + Vector3.new(3, -2.25, 0)
- pethead.Orientation = head.Orientation
- pettorso.Position = torso.Position + Vector3.new(3, -1.5, 0)
- pettorso.Orientation = torso.Orientation
- petleftarm.Position = pettorso.Position + Vector3.new(0.75, -0, 0)
- petleftarm.Orientation = leftarm.Orientation
- petrightarm.Position = pettorso.Position + Vector3.new(-0.75, -0, 0)
- petrightarm.Orientation = rightarm.Orientation
- petrightleg.Position = pettorso.Position + Vector3.new(-0.25, -1, 0)
- petrightleg.Orientation = rightleg.Orientation
- petleftleg.Position = pettorso.Position + Vector3.new(0.25, -1, 0)
- petleftleg.Orientation = leftleg.Orientation
- wait(0.001)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement