Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This script has been converted to FE by iPxter
- 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 | Translated to FE by iPxter")
- 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 = owner
- 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 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
- -------------
- --Can Drank--
- -------------
- --By --
- --CKbackup-
- -----------
- player = owner
- chara = player.Character
- debby = game.Debris
- rs = game:GetService("RunService").RenderStepped
- --Outfit--
- New = function(Object, Parent, Name, Data)
- local Object = Instance.new(Object)
- for Index, Value in pairs(Data or {}) do
- Object[Index] = Value
- end
- Object.Parent = Parent
- Object.Name = Name
- return Object
- end
- 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),})
- 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,})
- 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),})
- --Sounds--
- function LoadSnd(id,loop,vol,pit)
- local snd = New("Sound",chara,"Sound",{SoundId = "rbxassetid://"..id,Looped = loop,Volume = vol,Pitch = pit})
- return snd
- end
- DrinkSnd = LoadSnd(491214142,true,1,1)
- StartUpSnd = LoadSnd(10721950,false,1,1)
- SwingSnd = LoadSnd(158037267,false,1,1)
- function CreateTrailObj(parent,color1,color2,ofsx,ofsz)
- local Att1 = New("Attachment",parent,"Att1",{Position = Vector3.new(ofsx,parent.Size.Y/2,ofsz)})
- local Att2 = New("Attachment",parent,"Att2",{Position = Vector3.new(ofsx,-(parent.Size.Y/2),ofsz)})
- 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})
- return TEff
- end
- --Clerp Animations--
- TC = chara.HumanoidRootPart.RootJoint
- HC = chara.Torso.Neck
- RAC = chara.Torso["Right Shoulder"]
- LAC = chara.Torso["Left Shoulder"]
- RLC = chara.Torso["Right Hip"]
- LLC = chara.Torso["Left Hip"]
- TCF = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- HCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- RACF = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- LACF = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- RLCF = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- LLCF = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- RWF = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- LWF = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- RLWF = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- LLWF = CFrame.new(.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- RW = Instance.new("Weld",HC.Parent)
- RW.Part1 = HC.Parent
- RW.Part0 = chara["Right Arm"]
- RW.C0 = RWF
- function clerp(a,b,c)
- return a:lerp(b,c)
- end
- --TC.C0 = TCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
- --HC.C0 = HCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-50))
- --RW.C0 = (RWF + Vector3.new(1,2,0)) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-90))
- --LW.C0 = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2))
- RW.C0 = RWF
- --Idle Clerp--
- IRWF = (RWF - Vector3.new(-.2,0,-.5)) * CFrame.fromEulerAnglesXYZ(math.rad(-90),math.rad(-20),0)
- function res()
- RW.C0 = IRWF
- end
- res()
- --Mouse Functions--
- dif = 0
- function onKeyDown(key)
- if key == "q" then
- if dif == 0 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323705"
- dif = 1
- elseif dif == 1 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=11126634"
- dif = 2
- elseif dif == 2 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323909"
- dif = 3
- elseif dif == 3 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970071"
- dif = 4
- elseif dif == 4 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=16574454"
- dif = 5
- elseif dif == 5 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970256"
- dif = 6
- elseif dif == 6 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=10549894"
- dif = 7
- elseif dif == 7 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=15218018"
- dif = 8
- elseif dif == 8 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=28121842"
- dif = 9
- elseif dif == 9 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=24878483"
- dif = 10
- elseif dif == 10 then
- CanMesh.TextureId = "http://www.roblox.com/asset/?id=10470600"
- dif = 0
- end
- end
- end
- del = false
- normalwel = Weld.C0
- function onButton1Down()
- if del == false then
- del = true
- for i = 0,1,.2 do
- rs:wait()
- RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),i)
- HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),i)
- end
- 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)
- DrinkSnd:Play()
- wait(2)
- DrinkSnd:Stop()
- Weld.C0 = normalwel
- for i = 0,1,.2 do
- rs:wait()
- RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),1-i)
- HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),1-i)
- end
- SwingSnd:Play()
- for i = 0,1,.25 do
- rs:wait()
- RW.C0 = clerp(IRWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),i)
- end
- local fcan = Can:Clone()
- fcan.Weld:Destroy()
- fcan.Parent = workspace
- fcan.Position = Can.Position
- local bfos = Instance.new("BodyVelocity",fcan)
- bfos.P = 1000
- bfos.MaxForce = Vector3.new(1000,1000,1000)
- bfos.Velocity = Vector3.new(0,10,0) + chara.Head.CFrame.lookVector*-30
- debby:AddItem(bfos,.1)
- coroutine.resume(coroutine.create(function()
- wait(10)
- for i = 0,1,.1 do
- wait(.1)
- fcan.Transparency = i
- end
- fcan:Destroy()
- end))
- Can.Transparency = 1
- wait(1)
- for i = 0,1,.2 do
- rs:wait()
- RW.C0 = clerp(RWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),1-i)
- end
- wait(1)
- StartUpSnd:Play()
- for i = 0,1,.1 do
- wait(.1)
- Can.Transparency = 1-i
- end
- for i = 0,1,.2 do
- rs:wait()
- RW.C0 = clerp(RWF,IRWF,i)
- end
- del = false
- end
- end
- --Mouse Activation--
- if Mouse then
- Mouse.KeyDown:connect(onKeyDown)
- Mouse.Button1Down:connect(onButton1Down)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement