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,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros, Edited by StarzoZero")
- local rp = RealPlayer
- script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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(),Button2Up=fakeEvent(),Button2Down=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 then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- 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 Mouse = Player:GetMouse()
- 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,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- 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)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- player = owner
- char = player.Character
- mouse = player:GetMouse()
- Instance.new("Part",char)
- for _,v in pairs (char:children()) do
- if v:IsA("Part") then
- v.Transparency = 1
- end
- if v:IsA("Hat") or v:IsA("Accessory") then
- v:Destroy()
- end
- end
- head = Instance.new("Part",char)
- head.BrickColor = BrickColor.new("Maroon")
- head.Size = Vector3.new(4,4,4)
- head.Material = Enum.Material.SmoothPlastic
- weld = Instance.new("Weld",head)
- weld.Part0 = head
- weld.Part1 = char.HumanoidRootPart
- weld.C0 = CFrame.new(0, 1.25, 0)
- char.Head.face:Destroy()
- char.Torso.Neck.C0 = CFrame.new(0, 0, 0)
- face = Instance.new("Decal",head)
- face.Face = "Front"
- face.Texture = "http://www.roblox.com/asset/?id=28265270"
- roar = false
- eating = false
- sit = false
- lazer = false
- eatface = "http://www.roblox.com/asset/?id=1149279247"
- roarface = "http://www.roblox.com/asset/?id=479872542"
- reeface = "http://www.roblox.com/asset/?id=109676489"
- spagface = "http://www.roblox.com/asset/?id=162638969"
- lazerface = "http://www.roblox.com/asset/?id=280866530"
- spagm = "rbxassetid://830174420"
- function swait(num)
- if num == 0 or num == nil then
- ArtificialHB.Event:wait()
- else
- for i = 0, num do
- ArtificialHB.Event:wait()
- end
- end
- end
- local r = 255
- local g = 0
- local b = 0
- coroutine.resume(coroutine.create(function()
- while wait() do
- for i = 0, 254/5 do
- swait()
- g = g + 5
- end
- for i = 0, 254/5 do
- swait()
- r = r - 5
- end
- for i = 0, 254/5 do
- swait()
- b = b + 5
- end
- for i = 0, 254/5 do
- swait()
- g = g - 5
- end
- for i = 0, 254/5 do
- swait()
- r = r + 5
- end
- for i = 0, 254/5 do
- swait()
- b = b - 5
- end
- end
- end))
- mouse.KeyDown:connect(function(key)
- key=key:lower()
- if key == "q" and roar == false and lazer == false then
- if eating then
- eating = false
- face.Texture = "http://www.roblox.com/asset/?id=28265270"
- else
- eating = true
- face.Texture = eatface
- end
- end
- if key == "v" and lazer == false and roar == false then
- lazer = true
- local pos = Instance.new("Part",head)
- pos.Transparency = 1
- pos.CanCollide = false
- pos.Position = head.Position
- pos.Anchored = true
- local beam = Instance.new("Part",head)
- beam.Size = Vector3.new(3.95, 3.95, 1000)
- beam.CanCollide = false
- beam.Position = head.Position
- beam.Material = "Neon"
- local pew = Instance.new("Sound",head)
- pew.SoundId = "rbxassetid://294188875"
- pew.Volume = 10
- pew.Looped = true
- pew:Play()
- beam.Touched:connect(function(hit)
- if hit.Parent ~= workspace and hit.Name ~= "Base" and hit.Parent ~= char then
- hit:Destroy()
- end
- end)
- local ezweld = Instance.new("Weld",beam)
- ezweld.Part0 = beam
- ezweld.Part1 = pos
- ezweld.C0 = CFrame.new(0, 0, 502)
- face.Texture = lazerface
- repeat
- Swait()
- beam.Color = Color3.new(r/255,g/255,b/255)
- pos.CFrame = CFrame.new(head.Position, mouse.Hit.p)
- until lazer == false
- lazer = false
- pos:Destroy()
- beam:Destroy()
- pew:Destroy()
- face.Texture = "http://www.roblox.com/asset/?id=28265270"
- end
- if key == "e" and roar == false then
- roar = true
- local sick = Instance.new("Sound",char)
- sick.SoundId = "rbxassetid://138271815"
- sick.Pitch = 1
- sick.Name = "ROAR"
- sick.MaxDistance = 150
- sick.Volume = 2
- sick:Play()
- Rawr = sick
- face.Texture = roarface
- if Rawr then
- Rawr:Play()
- Swait(40)
- if eating == false then
- face.Texture = "http://www.roblox.com/asset/?id=28265270"
- roar = false
- else
- face.Texture = eatface
- roar = false
- end
- end
- end
- if key == "t" and roar == false then
- roar = true
- char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + 25
- local sick = Instance.new("Sound",char)
- sick.SoundId = "rbxassetid://1205457048"
- sick.Pitch = 1
- sick.Name = "REE"
- sick.MaxDistance = 150
- sick.Volume = 10
- sick:Play()
- Rawr = sick
- face.Texture = reeface
- if Rawr then
- Rawr:Play()
- Swait(140)
- if eating == false then
- face.Texture = "http://www.roblox.com/asset/?id=28265270"
- roar = false
- char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed - 25
- else
- face.Texture = eatface
- roar = false
- char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed - 25
- end
- end
- end
- if key == "x" and roar == false then
- roar = true
- char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + 0
- local sick = Instance.new("Sound",char)
- sick.SoundId = "rbxassetid://130992510"
- sick.Pitch = 1
- sick.Name = "spaghetti."
- sick.MaxDistance = 150
- sick.Volume = 10
- sick.TimePosition = 0
- sick:Play()
- Rawr = sick
- face.Texture = spagface
- local spaghet = Instance.new("Part",char)
- spaghet.Size = Vector3.new(0.1, 0.1, 0.1)
- spaghet.BrickColor = BrickColor.new("Gold")
- local weld = Instance.new("Weld",spaghet)
- weld.Part0 = spaghet
- weld.Part1 = head
- local mesh = Instance.new("SpecialMesh",spaghet)
- mesh.MeshId = spagm
- mesh.Offset = Vector3.new(0, 2, 0)
- mesh.Scale = Vector3.new(0.03, 0.03, 0.03)
- if Rawr then
- Rawr:Play()
- Swait(75)
- if eating == false then
- char.Humanoid.Health = char.Humanoid.Health + 15
- face.Texture = "http://www.roblox.com/asset/?id=28265270"
- roar = false
- Rawr:Destroy()
- spaghet:Destroy()
- char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed - 0
- else
- char.Humanoid.Health = char.Humanoid.Health + 15
- face.Texture = eatface
- roar = false
- Rawr:Destroy()
- spaghet:Destroy()
- char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed - 0
- end
- end
- end
- if key == "r" and roar == false then
- if sit then
- sit = false
- for _,v in pairs (char.Torso:children()) do
- if v:IsA("Seat") then
- v:Destroy()
- warn("Sitting Not Allowed")
- end
- end
- else
- sit = true
- warn("Sitting Allowed")
- local seat = Instance.new("Seat",char.Torso)
- seat.Transparency = 1
- seat.Position = head.Position
- local weld = Instance.new("Weld",seat)
- weld.Part0 = seat
- weld.Part1 = head
- weld.C0 = CFrame.new(0, -1, 0)
- end
- end
- end)
- mouse.KeyUp:connect(function(key)
- key=key:lower()
- if key == "v" then
- lazer = false
- end
- end)
- latestp = head
- ArtificialHB = Instance.new("BindableEvent", script)
- ArtificialHB.Name = "ArtificialHB"
- script:WaitForChild("ArtificialHB")
- Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
- frame = Frame_Speed
- tf = 0
- allowframeloss = false
- tossremainder = false
- lastframe = tick()
- script.ArtificialHB:Fire()
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.ArtificialHB:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- script.ArtificialHB:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end)
- function Swait(NUMBER)
- if NUMBER == 0 or NUMBER == nil then
- ArtificialHB.Event:wait()
- else
- for i = 1, NUMBER do
- ArtificialHB.Event:wait()
- end
- end
- end
- function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
- local NEWWELD = Instance.new(TYPE)
- NEWWELD.Part0 = PART0
- NEWWELD.Part1 = PART1
- NEWWELD.C0 = C0
- NEWWELD.C1 = C1
- NEWWELD.Parent = PARENT
- return NEWWELD
- end
- function ezweld(P1,P2,CFRAME)
- local ezweld = CreateWeldOrSnapOrMotor("Weld",char,P1,P2,CFRAME,CFrame.new(0,0,0))
- end
- function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
- local NEWPART = Instance.new("Part")
- NEWPART.formFactor = FORMFACTOR
- NEWPART.Reflectance = REFLECTANCE
- NEWPART.Transparency = TRANSPARENCY
- NEWPART.CanCollide = false
- NEWPART.Locked = true
- NEWPART.Anchored = true
- if ANCHOR == false then
- NEWPART.Anchored = false
- end
- NEWPART.BrickColor = BrickColor.new(tostring(BRICKCOLOR))
- NEWPART.Name = NAME
- NEWPART.Size = SIZE
- NEWPART.Position = char.Torso.Position
- NEWPART.Material = MATERIAL
- NEWPART:BreakJoints()
- NEWPART.Parent = PARENT
- return NEWPART
- end
- LatestP = head
- VT = Vector3.new
- Eaten = 0
- Networth = 0
- nom = Instance.new("Sound",head)
- nom.Volume = 10
- nom.SoundId = "rbxassetid://1278031541"
- song = Instance.new("Sound",head)
- song.Volume = 5
- song.SoundId = "rbxassetid://1349023179"
- song.Looped = true
- song:Play()
- local sur = Instance.new("BillboardGui", head)
- sur.Name = "BillboardGui"
- sur.Adornee = head
- sur.Size = UDim2.new(4, 0, 0.5, 0)
- sur.StudsOffset = Vector3.new(0, 8, 0)
- local text = Instance.new("TextBox", sur)
- text.Text = "Munchy Boi"
- text.Size = UDim2.new(1, 0, 5, 0)
- text.TextScaled = true
- text.BackgroundTransparency = 1
- text.Font = Enum.Font.Arcade
- text.TextColor3 = BrickColor.new("Maroon").Color
- text.TextStrokeColor3 = BrickColor.new("Gold").Color
- text.TextStrokeTransparency = 0
- local sur2 = Instance.new("BillboardGui", head)
- sur2.Name = "BillboardGui"
- sur2.Adornee = head
- sur2.Size = UDim2.new(1, 0, 0.5, 0)
- sur2.StudsOffset = Vector3.new(0, 0, 0)
- local text2 = Instance.new("TextBox", sur)
- text2.Text = owner.Name
- text2.Size = UDim2.new(1, 0, 1, 0)
- text2.TextScaled = true
- text2.BackgroundTransparency = 1
- text2.Font = Enum.Font.Arcade
- text2.TextColor3 = BrickColor.new("Maroon").Color
- text2.TextStrokeColor3 = BrickColor.new("Gold").Color
- text2.TextStrokeTransparency = 0
- head.Touched:connect(function(hit)
- if hit.Parent ~= char and hit.Name ~= "Base" and eating == true and hit ~= head then
- Eaten = Eaten + 1
- hit:Destroy()
- Networth = Networth + 1
- nom:Play()
- char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + 0.1
- end
- if Eaten == 3 or Eaten > 3 then
- Eaten = 0
- local AP = CreatePart(3,char,"SmoothPlastic",0,0,"Gold","Sitting",Vector3.new(4,4,4),false)
- ezweld(AP,LatestP,CFrame.new(0,-0.2,-3))
- AP.Massless = true
- Swait()
- AP.CanCollide = true
- Swait(2)
- AP:BreakJoints()
- local Rope = Instance.new("SpringConstraint",LatestP)
- local Attach = Instance.new("Attachment",LatestP)
- local Attach2 = Instance.new("Attachment",AP)
- Attach.Position = Vector3.new(0,0,2)
- Attach2.Position = Vector3.new(0,0,-2)
- Rope.Attachment0 = Attach
- Rope.Attachment1 = Attach2
- Rope.Visible = true
- Rope.Color = BrickColor.new("Gold")
- Rope.Coils = 3
- Rope.Radius = 0.1
- Rope.MaxLength = 1
- Rope.MinLength = 0
- Rope.MaxForce = 0.2
- Rope.LimitsEnabled = true
- LatestP = AP
- end
- end)
- --Instructions:
- --Making the worm model:
- --Make sure to use Instance.new("Part",char)
- --Make sure to put player = owner at the start of the script
- --(player is a variable for the person using the script)
- --Make sure to put char = player.Character after player = owner
- --(make sure to drop lines with Enter when you finish a line of code.)
- --Make sure to put head = Instance.new("Part",char) and also after that
- --head.BrickColor = BrickColor.new("color")
- --Part 2: Making the eat command
- --WARNING: DO NOT DO THIS UNTIL I SAY YOU SHOULD, AND DONT DO IT WITHOUT
- --READING THE TUTORIAL PLEASE.
- --I will write the instructions for the eat command when you have finished the
- --character
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement