Advertisement
TheJake678

do

Feb 8th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.77 KB | None | 0 0
  1. -------------
  2. --Can Drank-- -- This script has convert to FE by who i don't know?
  3.  
  4. -----------------------------------------------------
  5. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  6. local Player,game,owner = owner,game
  7. local RealPlayer = Player
  8. do
  9. print("FE Compatibility code by Mokiros | Showcase by Bacon Hair!")
  10. local rp = RealPlayer
  11. script.Parent = rp.Character
  12.  
  13. --RemoteEvent for communicating
  14. local Event = Instance.new("RemoteEvent")
  15. Event.Name = "UserInput_Event"
  16.  
  17. --Fake event to make stuff like Mouse.KeyDown work
  18. local function fakeEvent()
  19. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  20. t.connect = t.Connect
  21. return t
  22. end
  23.  
  24. --Creating fake input objects with fake variables
  25. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  26. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  27. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  28. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  29. end}
  30. --Merged 2 functions into one by checking amount of arguments
  31. CAS.UnbindAction = CAS.BindAction
  32.  
  33. --This function will trigger the events that have been :Connect()'ed
  34. local function te(self,ev,...)
  35. local t = m[ev]
  36. if t and t._fakeEvent then
  37. for _,f in pairs(t.Functions) do
  38. f(...)
  39. end
  40. end
  41. end
  42. m.TrigEvent = te
  43. UIS.TrigEvent = te
  44.  
  45. Event.OnServerEvent:Connect(function(plr,io)
  46. if plr~=rp then return end
  47. m.Target = io.Target
  48. m.Hit = io.Hit
  49. if not io.isMouse then
  50. local b = io.UserInputState == Enum.UserInputState.Begin
  51. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  52. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68.  
  69. local Mouse = Player:GetMouse()
  70. local UIS = game:GetService("UserInputService")
  71. local input = function(io,a)
  72. if a then return end
  73. --Since InputObject is a client-side instance, we create and pass table instead
  74. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  75. end
  76. UIS.InputBegan:Connect(input)
  77. UIS.InputEnded:Connect(input)
  78.  
  79. local h,t
  80. --Give the server mouse data 30 times every second, but only if the values changed
  81. --If player is not moving their mouse, client won't fire events
  82. while wait(1/30) do
  83. if h~=Mouse.Hit or t~=Mouse.Target then
  84. h,t=Mouse.Hit,Mouse.Target
  85. Event:FireServer({isMouse=true,Target=t,Hit=h})
  86. end
  87. end]==],Player.Character)
  88.  
  89. ----Sandboxed game object that allows the usage of client-side methods and services
  90. --Real game object
  91. local _rg = game
  92.  
  93. --Metatable for fake service
  94. local fsmt = {
  95. __index = function(self,k)
  96. local s = rawget(self,"_RealService")
  97. if s then return s[k] end
  98. end,
  99. __newindex = function(self,k,v)
  100. local s = rawget(self,"_RealService")
  101. if s then s[k]=v end
  102. end,
  103. __call = function(self,...)
  104. local s = rawget(self,"_RealService")
  105. if s then return s(...) end
  106. end
  107. }
  108. local function FakeService(t,RealService)
  109. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  110. return setmetatable(t,fsmt)
  111. end
  112.  
  113. --Fake game object
  114. local g = {
  115. GetService = function(self,s)
  116. return self[s]
  117. end,
  118. Players = FakeService({
  119. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  120. },"Players"),
  121. UserInputService = FakeService(UIS,"UserInputService"),
  122. ContextActionService = FakeService(CAS,"ContextActionService"),
  123. }
  124. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  125. g.service = g.GetService
  126.  
  127. g.RunService = FakeService({
  128.  
  129. BindToRenderStep = function(self,name,_,fun)
  130.  
  131. end,
  132. UnbindFromRenderStep = function(self,name)
  133. self._btrs[name]:Disconnect()
  134. end,
  135. },"RunService")
  136.  
  137. setmetatable(g,{
  138. __index=function(self,s)
  139. return _rg:GetService(s) or typeof(_rg[s])=="function"
  140. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  141. end,
  142. __newindex = fsmt.__newindex,
  143. __call = fsmt.__call
  144. })
  145. --Changing owner to fake player object to support owner:GetMouse()
  146. game,owner = g,g.Players.LocalPlayer
  147. end
  148. -------------
  149. --By --
  150. --CKbackup-
  151. -----------
  152.  
  153. player = owner
  154. chara = player.Character
  155. debby = game.Debris
  156. Mouse = player:GetMouse(Global)
  157. rs = game:GetService("RunService")
  158.  
  159. --Outfit--
  160. New = function(Object, Parent, Name, Data)
  161. local Object = Instance.new(Object)
  162. for Index, Value in pairs(Data or {}) do
  163. Object[Index] = Value
  164. end
  165. Object.Parent = Parent
  166. Object.Name = Name
  167. return Object
  168. end
  169.  
  170. Can = New("Part",chara,"Can",{Size = Vector3.new(0.800000012, 1.20000005, 0.800000012),CFrame = CFrame.new(-30.8000011, 1.60000002, -33, 0.707107842, 0, -0.70710814, 0, 1, 0, 0.70710814, 0, 0.707107842),})
  171. CanMesh = New("SpecialMesh",Can,"CanMesh",{Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005),MeshId = "http://www.roblox.com/asset/?id=10470609",TextureId = "rbxassetid://10470600",MeshType = Enum.MeshType.FileMesh,})
  172. Weld = New("ManualWeld",Can,"Weld",{Part0 = Can,Part1 = chara["Right Arm"],C0 = CFrame.new(0, 0, 0, 0.707107842, 0, 0.70710814, 0, 1, 0, -0.70710814, 0, 0.707107842),C1 = CFrame.new(-0.300001144, -1, -0.100000024, 1, 0, 0, 0, 0, 1, -0, -1, -0),})
  173.  
  174. --Sounds--
  175. function LoadSnd(id,loop,vol,pit)
  176. local snd = New("Sound",chara,"Sound",{SoundId = "rbxassetid://"..id,Looped = loop,Volume = vol,Pitch = pit})
  177. return snd
  178. end
  179. DrinkSnd = LoadSnd(491214142,true,1,1)
  180. StartUpSnd = LoadSnd(10721950,false,1,1)
  181. SwingSnd = LoadSnd(158037267,false,1,1)
  182.  
  183. function CreateTrailObj(parent,color1,color2,ofsx,ofsz)
  184. local Att1 = New("Attachment",parent,"Att1",{Position = Vector3.new(ofsx,parent.Size.Y/2,ofsz)})
  185. local Att2 = New("Attachment",parent,"Att2",{Position = Vector3.new(ofsx,-(parent.Size.Y/2),ofsz)})
  186. local TEff = New("Trail",parent,"TrailEff",{Color = ColorSequence.new({ColorSequenceKeypoint.new(0,BrickColor.new(color1).Color),ColorSequenceKeypoint.new(1,BrickColor.new(color2).Color)}),Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,.5),NumberSequenceKeypoint.new(1,1)}),Attachment0 = Att1,Attachment1 = Att2,Enabled = false,Lifetime = .5,MinLength = .001})
  187. return TEff
  188. end
  189.  
  190. --Clerp Animations--
  191. TC = chara.HumanoidRootPart.RootJoint
  192. HC = chara.Torso.Neck
  193. RAC = chara.Torso["Right Shoulder"]
  194. LAC = chara.Torso["Left Shoulder"]
  195. RLC = chara.Torso["Right Hip"]
  196. LLC = chara.Torso["Left Hip"]
  197. TCF = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  198. HCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  199. RACF = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  200. LACF = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  201. RLCF = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  202. LLCF = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  203. RWF = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  204. LWF = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  205. RLWF = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  206. LLWF = CFrame.new(.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  207. RW = Instance.new("Weld",HC.Parent)
  208. RW.Part1 = HC.Parent
  209. RW.Part0 = chara["Right Arm"]
  210. RW.C0 = RWF
  211.  
  212. function clerp(a,b,c)
  213. return a:lerp(b,c)
  214. end
  215.  
  216. --TC.C0 = TCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
  217. --HC.C0 = HCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-50))
  218. --RW.C0 = (RWF + Vector3.new(1,2,0)) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-90))
  219. --LW.C0 = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2))
  220.  
  221. RW.C0 = RWF
  222.  
  223. --Idle Clerp--
  224. IRWF = (RWF - Vector3.new(-.2,0,-.5)) * CFrame.fromEulerAnglesXYZ(math.rad(-90),math.rad(-20),0)
  225.  
  226. function res()
  227. RW.C0 = IRWF
  228. end
  229. res()
  230.  
  231. --Mouse Functions--
  232. dif = 0
  233. function onKeyDown(key)
  234. if key == "q" then
  235. if dif == 0 then
  236. CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323705"
  237. dif = 1
  238. elseif dif == 1 then
  239. CanMesh.TextureId = "http://www.roblox.com/asset/?id=11126634"
  240. dif = 2
  241. elseif dif == 2 then
  242. CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323909"
  243. dif = 3
  244. elseif dif == 3 then
  245. CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970071"
  246. dif = 4
  247. elseif dif == 4 then
  248. CanMesh.TextureId = "http://www.roblox.com/asset/?id=16574454"
  249. dif = 5
  250. elseif dif == 5 then
  251. CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970256"
  252. dif = 6
  253. elseif dif == 6 then
  254. CanMesh.TextureId = "http://www.roblox.com/asset/?id=10549894"
  255. dif = 7
  256. elseif dif == 7 then
  257. CanMesh.TextureId = "http://www.roblox.com/asset/?id=15218018"
  258. dif = 8
  259. elseif dif == 8 then
  260. CanMesh.TextureId = "http://www.roblox.com/asset/?id=28121842"
  261. dif = 9
  262. elseif dif == 9 then
  263. CanMesh.TextureId = "http://www.roblox.com/asset/?id=24878483"
  264. dif = 10
  265. elseif dif == 10 then
  266. CanMesh.TextureId = "http://www.roblox.com/asset/?id=10470600"
  267. dif = 0
  268. end
  269. end
  270. end
  271. del = false
  272. normalwel = Weld.C0
  273. function onButton1Down()
  274. if del == false then
  275. del = true
  276. for i = 0,1,.2 do
  277. rs:wait()
  278. RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),i)
  279. HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),i)
  280. end
  281. Weld.C0 = CFrame.new(0, 0, 0, -0.122617364, -0.0738587826, 0.989701807, -0.81083709, 0.582491338, -0.0569874756, -0.572283864, -0.809474528, -0.13131094)
  282. DrinkSnd:Play()
  283. wait(2)
  284. DrinkSnd:Stop()
  285. Weld.C0 = normalwel
  286. for i = 0,1,.2 do
  287. rs:wait()
  288. RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),1-i)
  289. HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),1-i)
  290. end
  291. SwingSnd:Play()
  292. for i = 0,1,.25 do
  293. rs:wait()
  294. RW.C0 = clerp(IRWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),i)
  295. end
  296. local fcan = Can:Clone()
  297. fcan.Weld:Destroy()
  298. fcan.Parent = workspace
  299. fcan.Position = Can.Position
  300. local bfos = Instance.new("BodyVelocity",fcan)
  301. bfos.P = 1000
  302. bfos.MaxForce = Vector3.new(1000,1000,1000)
  303. bfos.Velocity = Vector3.new(0,10,0) + chara.Head.CFrame.lookVector*-30
  304. debby:AddItem(bfos,.1)
  305. coroutine.resume(coroutine.create(function()
  306. wait(10)
  307. for i = 0,1,.1 do
  308. wait(.1)
  309. fcan.Transparency = i
  310. end
  311. fcan:Destroy()
  312. end))
  313. Can.Transparency = 1
  314. wait(1)
  315. for i = 0,1,.2 do
  316. rs:wait()
  317. RW.C0 = clerp(RWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),1-i)
  318. end
  319. wait(1)
  320. StartUpSnd:Play()
  321. for i = 0,1,.1 do
  322. wait(.1)
  323. Can.Transparency = 1-i
  324. end
  325. for i = 0,1,.2 do
  326. rs:wait()
  327. RW.C0 = clerp(RWF,IRWF,i)
  328. end
  329. del = false
  330. end
  331. end
  332.  
  333. --Mouse Activation--
  334. if Mouse then
  335. Mouse.KeyDown:connect(onKeyDown)
  336. Mouse.Button1Down:connect(onButton1Down)
  337. endf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement