Advertisement
Webcat70

Webcat70's Sprite Cranberry Script

Dec 12th, 2018
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.05 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. local RealPlayer = Player
  4. do print("FE Compatibility code by Mokiros")local a=RealPlayer;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  5. mouse = owner:GetMouse()
  6. print("Sprite Cranberry Script By: Webcat70")
  7. print("Controls:")
  8. print("'q' = \"The answer is cleeeaar!\"")
  9. print("'e' = \"Wan't a Sprite Cranberry?\"")
  10. print("'r' = \"It's the thirst-thirstiest time of the year!\"")
  11. print("'LMB' = Drink")
  12. local t = Instance.new("Tool")
  13. t.Name = "Sprite Cranberry"
  14. local h = Instance.new("Part")
  15. h.Name = ("Handle")
  16. h.Parent = t
  17. local m = Instance.new("FileMesh")
  18. m.MeshId = "http://www.roblox.com/asset/?id=10470609"
  19. m.TextureId= "rbxassetid://2594744339"
  20. m.Parent = h
  21. local s1 = Instance.new("Sound")
  22. s1.Name = "Sound1"
  23. s1.SoundId = "rbxassetid://2610540529"
  24. s1.Volume = 1
  25. s1.Parent = h
  26. local s2 = Instance.new("Sound")
  27. s2.Name = "Sound2"
  28. s2.SoundId = "rbxassetid://2615889602"
  29. s2.Volume = 1
  30. s2.Parent = h
  31. local s3 = Instance.new("Sound")
  32. s3.Name = "Sound3"
  33. s3.SoundId = "rbxassetid://10721950"
  34. s3.Volume = 3
  35. s3.Parent = h
  36. local s4 = Instance.new("Sound")
  37. s4.Name = "Sound4"
  38. s4.SoundId = "rbxassetid://10722059"
  39. s4.Volume = 1
  40. s4.Parent = h
  41. local s5 = Instance.new("Sound")
  42. s5.Name = "Sound5"
  43. s5.SoundId = "rbxassetid://2615889602"
  44. s5.Volume = 1
  45. s5.Parent = h
  46. t.Parent = owner.Backpack
  47. script.Parent = t
  48. local d1 = false
  49. local d2 = false
  50. local d3 = false
  51. local d4 = false
  52. mouse.KeyDown:Connect(function(k1)
  53.     if k1 == "e" then
  54.         if script.Parent.Parent.Name == owner.Name then
  55.             if d1 == false then
  56.                 d1 = true
  57.                 if not script.Parent.Handle:FindFirstChild("Sound1") then
  58.                     local s1 = Instance.new("Sound")
  59.                     s1.Name = "Sound1"
  60.                     s1.SoundId = "rbxassetid://2610540529"
  61.                     s1.Volume = 1
  62.                     s1.Parent = h
  63.                 end
  64.                 script.Parent.Handle.Sound1:Play()
  65.                 wait(1.2)
  66.                 d1 = false
  67.             end
  68.         end
  69.     end
  70. end)
  71. mouse.KeyDown:Connect(function(k2)
  72.     if k2 == "q" then
  73.         if script.Parent.Parent.Name == owner.Name then
  74.             if d2 == false then
  75.                 d2 = true
  76.                 if not script.Parent.Handle:FindFirstChild("Sound2") then
  77.                     local s2 = Instance.new("Sound")
  78.                     s2.Name = "Sound2"
  79.                     s2.SoundId = "rbxassetid://2615889602"
  80.                     s2.Volume = 1
  81.                     s2.Parent = h
  82.                 end
  83.                 script.Parent.Handle.Sound2.TimePosition = 19.5
  84.                 script.Parent.Handle.Sound2:Play()
  85.                 wait(3)
  86.                 script.Parent.Handle.Sound2:Stop()
  87.                 d2 = false
  88.             end
  89.         end
  90.     end
  91. end)
  92. mouse.KeyDown:Connect(function(k3)
  93.     if k3 == "r" then
  94.         if script.Parent.Parent.Name == owner.Name then
  95.             if d3 == false then
  96.                 d3 = true
  97.                 if not script.Parent.Handle:FindFirstChild("Sound5") then
  98.                     local s5 = Instance.new("Sound")
  99.                     s5.Name = "Sound5"
  100.                     s5.SoundId = "rbxassetid://2615889602"
  101.                     s5.Volume = 5
  102.                     s5.Parent = h
  103.                 end
  104.                 script.Parent.Handle.Sound5.TimePosition = 8.5
  105.                 script.Parent.Handle.Sound5:Play()
  106.                 wait(4.6)
  107.                 script.Parent.Handle.Sound5:Stop()
  108.                 d3 = false
  109.             end
  110.         end
  111.     end
  112. end)
  113. mouse.Button1Down:Connect(function()
  114.     if script.Parent.Parent.Name == owner.Name then
  115.         if d4 == false then
  116.             d4 = true
  117.             if not script.Parent.Handle:FindFirstChild("Sound4") then
  118.                 local s4 = Instance.new("Sound")
  119.                 s4.Name = "Sound4"
  120.                 s4.SoundId = "rbxassetid://10722059"
  121.                 s4.Volume = 1
  122.                 s4.Parent = h
  123.             end
  124.             owner.Character.Torso["Right Shoulder"].C0 = CFrame.new(0.9,0.5,-0.05) * CFrame.Angles(0.2,2,0)
  125.             wait(0.05)
  126.             owner.Character.Torso["Right Shoulder"].C0 = CFrame.new(0.8,0.5,-0.1) * CFrame.Angles(0.4,2.4,0)
  127.             script.Parent.Handle.Sound4:Play()
  128.             for i = 1,30 do
  129.                 wait(0.1)
  130.                 owner.Character.Humanoid.Health = owner.Character.Humanoid.Health + 1
  131.             end
  132.             owner.Character.Torso["Right Shoulder"].C0 = CFrame.new(0.9,0.5,-0.05) * CFrame.Angles(0.2,2,0)
  133.             wait(0.05)
  134.             owner.Character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,-0) * CFrame.Angles(0,1.57,0)
  135.             wait(0.5)
  136.             d4 = false
  137.         end
  138.     end
  139. end)
  140. script.Parent.Equipped:Connect(function()
  141.     if not script.Parent.Handle:FindFirstChild("Sound3") then
  142.         local s3 = Instance.new("Sound")
  143.         s3.Name = "Sound3"
  144.         s3.SoundId = "rbxassetid://10721950"
  145.         s3.Volume = 1
  146.         s3.Parent = h
  147.     end
  148.     script.Parent.Handle.Sound3:Play()
  149. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement