Advertisement
5325325325

Untitled

Oct 27th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.27 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = owner
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local h,t
  75. --Give the server mouse data 30 times every second, but only if the values changed
  76. --If player is not moving their mouse, client won't fire events
  77. while wait(1/30) do
  78. if h~=Mouse.Hit or t~=Mouse.Target then
  79. h,t=Mouse.Hit,Mouse.Target
  80. Event:FireServer({isMouse=true,Target=t,Hit=h})
  81. end
  82. end]==],Player.Character)
  83. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  84. end
  85.  
  86. -------------
  87. --Can Drank--
  88. -------------
  89. --By --
  90. --CKbackup-
  91. -----------
  92.  
  93. player = owner
  94. chara = player.Character
  95. debby = game.Debris
  96. rs = game:GetService("RunService").RenderStepped
  97.  
  98. --Outfit--
  99. New = function(Object, Parent, Name, Data)
  100. local Object = Instance.new(Object)
  101. for Index, Value in pairs(Data or {}) do
  102. Object[Index] = Value
  103. end
  104. Object.Parent = Parent
  105. Object.Name = Name
  106. return Object
  107. end
  108.  
  109. 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),})
  110. 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,})
  111. 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),})
  112.  
  113. --Sounds--
  114. function LoadSnd(id,loop,vol,pit)
  115. local snd = New("Sound",chara,"Sound",{SoundId = "rbxassetid://"..id,Looped = loop,Volume = vol,Pitch = pit})
  116. return snd
  117. end
  118. DrinkSnd = LoadSnd(491214142,true,1,1)
  119. StartUpSnd = LoadSnd(10721950,false,1,1)
  120. SwingSnd = LoadSnd(158037267,false,1,1)
  121.  
  122. function CreateTrailObj(parent,color1,color2,ofsx,ofsz)
  123. local Att1 = New("Attachment",parent,"Att1",{Position = Vector3.new(ofsx,parent.Size.Y/2,ofsz)})
  124. local Att2 = New("Attachment",parent,"Att2",{Position = Vector3.new(ofsx,-(parent.Size.Y/2),ofsz)})
  125. 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})
  126. return TEff
  127. end
  128.  
  129. --Clerp Animations--
  130. TC = chara.HumanoidRootPart.RootJoint
  131. HC = chara.Torso.Neck
  132. RAC = chara.Torso["Right Shoulder"]
  133. LAC = chara.Torso["Left Shoulder"]
  134. RLC = chara.Torso["Right Hip"]
  135. LLC = chara.Torso["Left Hip"]
  136. TCF = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  137. HCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  138. RACF = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  139. LACF = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  140. RLCF = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  141. LLCF = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  142. RWF = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  143. LWF = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  144. RLWF = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  145. LLWF = CFrame.new(.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  146. RW = Instance.new("Weld",HC.Parent)
  147. RW.Part1 = HC.Parent
  148. RW.Part0 = chara["Right Arm"]
  149. RW.C0 = RWF
  150.  
  151. function clerp(a,b,c)
  152. return a:lerp(b,c)
  153. end
  154.  
  155. --TC.C0 = TCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
  156. --HC.C0 = HCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-50))
  157. --RW.C0 = (RWF + Vector3.new(1,2,0)) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-90))
  158. --LW.C0 = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2))
  159.  
  160. RW.C0 = RWF
  161.  
  162. --Idle Clerp--
  163. IRWF = (RWF - Vector3.new(-.2,0,-.5)) * CFrame.fromEulerAnglesXYZ(math.rad(-90),math.rad(-20),0)
  164.  
  165. function res()
  166. RW.C0 = IRWF
  167. end
  168. res()
  169.  
  170. --Mouse Functions--
  171. dif = 0
  172. function onKeyDown(key)
  173. if key == "q" then
  174. if dif == 0 then
  175. CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323705"
  176. dif = 1
  177. elseif dif == 1 then
  178. CanMesh.TextureId = "http://www.roblox.com/asset/?id=11126634"
  179. dif = 2
  180. elseif dif == 2 then
  181. CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323909"
  182. dif = 3
  183. elseif dif == 3 then
  184. CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970071"
  185. dif = 4
  186. elseif dif == 4 then
  187. CanMesh.TextureId = "http://www.roblox.com/asset/?id=16574454"
  188. dif = 5
  189. elseif dif == 5 then
  190. CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970256"
  191. dif = 6
  192. elseif dif == 6 then
  193. CanMesh.TextureId = "http://www.roblox.com/asset/?id=10549894"
  194. dif = 7
  195. elseif dif == 7 then
  196. CanMesh.TextureId = "http://www.roblox.com/asset/?id=15218018"
  197. dif = 8
  198. elseif dif == 8 then
  199. CanMesh.TextureId = "http://www.roblox.com/asset/?id=28121842"
  200. dif = 9
  201. elseif dif == 9 then
  202. CanMesh.TextureId = "http://www.roblox.com/asset/?id=24878483"
  203. dif = 10
  204. elseif dif == 10 then
  205. CanMesh.TextureId = "http://www.roblox.com/asset/?id=10470600"
  206. dif = 0
  207. end
  208. end
  209. end
  210. del = false
  211. normalwel = Weld.C0
  212. function onButton1Down()
  213. if del == false then
  214. del = true
  215. for i = 0,1,.2 do
  216. rs:wait()
  217. RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),i)
  218. HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),i)
  219. end
  220. 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)
  221. DrinkSnd:Play()
  222. wait(2)
  223. DrinkSnd:Stop()
  224. Weld.C0 = normalwel
  225. for i = 0,1,.2 do
  226. rs:wait()
  227. RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),1-i)
  228. HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),1-i)
  229. end
  230. SwingSnd:Play()
  231. for i = 0,1,.25 do
  232. rs:wait()
  233. RW.C0 = clerp(IRWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),i)
  234. end
  235. local fcan = Can:Clone()
  236. fcan.Weld:Destroy()
  237. fcan.Parent = workspace
  238. fcan.Position = Can.Position
  239. local bfos = Instance.new("BodyVelocity",fcan)
  240. bfos.P = 1000
  241. bfos.MaxForce = Vector3.new(1000,1000,1000)
  242. bfos.Velocity = Vector3.new(0,10,0) + chara.Head.CFrame.lookVector*-30
  243. debby:AddItem(bfos,.1)
  244. coroutine.resume(coroutine.create(function()
  245. wait(10)
  246. for i = 0,1,.1 do
  247. wait(.1)
  248. fcan.Transparency = i
  249. end
  250. fcan:Destroy()
  251. end))
  252. Can.Transparency = 1
  253. wait(1)
  254. for i = 0,1,.2 do
  255. rs:wait()
  256. RW.C0 = clerp(RWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),1-i)
  257. end
  258. wait(1)
  259. StartUpSnd:Play()
  260. for i = 0,1,.1 do
  261. wait(.1)
  262. Can.Transparency = 1-i
  263. end
  264. for i = 0,1,.2 do
  265. rs:wait()
  266. RW.C0 = clerp(RWF,IRWF,i)
  267. end
  268. del = false
  269. end
  270. end
  271.  
  272. --Mouse Activation--
  273. if Mouse then
  274. Mouse.KeyDown:connect(onKeyDown)
  275. Mouse.Button1Down:connect(onButton1Down)
  276. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement