SHOW:
|
|
- or go back to the newest paste.
| 1 | --just put this on the top of a script and boom 89% works | |
| 2 | --note this does not work on big scripts | |
| 3 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 4 | local Player,game,owner = owner,game | |
| 5 | local RealPlayer = Player | |
| 6 | do | |
| 7 | local rp = RealPlayer | |
| 8 | script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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 then | |
| 34 | for _,f in pairs(t.Functions) do | |
| 35 | f(...) | |
| 36 | end | |
| 37 | end | |
| 38 | end | |
| 39 | m.TrigEvent = te | |
| 40 | UIS.TrigEvent = te | |
| 41 | ||
| 42 | Event.OnServerEvent:Connect(function(plr,io) | |
| 43 | if plr~=rp then return end | |
| 44 | m.Target = io.Target | |
| 45 | m.Hit = io.Hit | |
| 46 | if not io.isMouse then | |
| 47 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 48 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 49 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 50 | end | |
| 51 | for _,t in pairs(CAS.Actions) do | |
| 52 | for _,k in pairs(t.Keys) do | |
| 53 | if k==io.KeyCode then | |
| 54 | t.Function(t.Name,io.UserInputState,io) | |
| 55 | end | |
| 56 | end | |
| 57 | end | |
| 58 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 59 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 60 | end | |
| 61 | end) | |
| 62 | Event.Parent = NLS([==[ | |
| 63 | local Player = game:GetService("Players").LocalPlayer
| |
| 64 | local Event = script:WaitForChild("UserInput_Event")
| |
| 65 | ||
| 66 | local Mouse = Player:GetMouse() | |
| 67 | local UIS = game:GetService("UserInputService")
| |
| 68 | local input = function(io,a) | |
| 69 | if a then return end | |
| 70 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 71 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 72 | end | |
| 73 | UIS.InputBegan:Connect(input) | |
| 74 | UIS.InputEnded:Connect(input) | |
| 75 | ||
| 76 | local h,t | |
| 77 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 78 | --If player is not moving their mouse, client won't fire events | |
| 79 | while wait(1/30) do | |
| 80 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 81 | h,t=Mouse.Hit,Mouse.Target | |
| 82 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 83 | end | |
| 84 | end]==],Player.Character) | |
| 85 | ||
| 86 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 87 | --Real game object | |
| 88 | local _rg = game | |
| 89 | ||
| 90 | --Metatable for fake service | |
| 91 | local fsmt = {
| |
| 92 | __index = function(self,k) | |
| 93 | local s = rawget(self,"_RealService") | |
| 94 | if s then return s[k] end | |
| 95 | end, | |
| 96 | __newindex = function(self,k,v) | |
| 97 | local s = rawget(self,"_RealService") | |
| 98 | if s then s[k]=v end | |
| 99 | end, | |
| 100 | __call = function(self,...) | |
| 101 | local s = rawget(self,"_RealService") | |
| 102 | if s then return s(...) end | |
| 103 | end | |
| 104 | } | |
| 105 | local function FakeService(t,RealService) | |
| 106 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 107 | return setmetatable(t,fsmt) | |
| 108 | end | |
| 109 | ||
| 110 | --Fake game object | |
| 111 | local g = {
| |
| 112 | GetService = function(self,s) | |
| 113 | return self[s] | |
| 114 | end, | |
| 115 | Players = FakeService({
| |
| 116 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 117 | },"Players"), | |
| 118 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 119 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 120 | } | |
| 121 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 122 | g.service = g.GetService | |
| 123 | ||
| 124 | g.RunService = FakeService({
| |
| 125 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 126 | BindToRenderStep = function(self,name,_,fun) | |
| 127 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 128 | end, | |
| 129 | UnbindFromRenderStep = function(self,name) | |
| 130 | self._btrs[name]:Disconnect() | |
| 131 | end, | |
| 132 | },"RunService") | |
| 133 | ||
| 134 | setmetatable(g,{
| |
| 135 | __index=function(self,s) | |
| 136 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
| 137 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
| 138 | end, | |
| 139 | __newindex = fsmt.__newindex, | |
| 140 | __call = fsmt.__call | |
| 141 | }) | |
| 142 | --Changing owner to fake player object to support owner:GetMouse() | |
| 143 | game,owner = g,g.Players.LocalPlayer | |
| 144 | end | |
| 145 | ||
| 146 | ||
| 147 | local me = game:service("Players").LocalPlayer
| |
| 148 | local char = me.Character | |
| 149 | local Modelname = "LemonadeModel" | |
| 150 | local Toolname = "Lemonade" | |
| 151 | script.Name = "bin" | |
| 152 | if char:FindFirstChild(Modelname) then | |
| 153 | char[Modelname].Parent = nil | |
| 154 | end | |
| 155 | for _, v in pairs(me.Backpack:GetChildren()) do | |
| 156 | if v:FindFirstChild("tooltype") then
| |
| 157 | if v.tooltype.Value == Toolname then | |
| 158 | v.Parent = nil | |
| 159 | end | |
| 160 | end | |
| 161 | end | |
| 162 | local aing | |
| 163 | local phpos | |
| 164 | local hpos | |
| 165 | local bin = Instance.new("HopperBin", me.Backpack)
| |
| 166 | bin.Name = Toolname | |
| 167 | local tooltype = Instance.new("StringValue", bin)
| |
| 168 | tooltype.Name = "tooltype" | |
| 169 | tooltype.Value = Toolname | |
| 170 | script.Parent = bin | |
| 171 | local able = true | |
| 172 | local sable1 = true | |
| 173 | local surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
| |
| 174 | if char:FindFirstChild("Torso") and char:FindFirstChild("Right Arm") and char:FindFirstChild("Left Arm") then
| |
| 175 | ||
| 176 | else | |
| 177 | script:remove() | |
| 178 | end | |
| 179 | torso = char.Torso | |
| 180 | neck = torso.Neck | |
| 181 | human = char.Humanoid | |
| 182 | Rarm = char["Right Arm"] | |
| 183 | Larm = char["Left Arm"] | |
| 184 | local Sounds = {
| |
| 185 | drink = Instance.new("Sound"),
| |
| 186 | swing = Instance.new("Sound"),
| |
| 187 | hitsound = Instance.new("Sound")
| |
| 188 | } | |
| 189 | Sounds["drink"].SoundId = "http://www.roblox.com/asset/?id=10722059" | |
| 190 | Sounds["drink"].Volume = 1 | |
| 191 | Sounds["swing"].SoundId = "http://www.roblox.com/asset/?id=10209645" | |
| 192 | Sounds["swing"].Volume = 1 | |
| 193 | Sounds["hitsound"].SoundId = "http://www.roblox.com/asset/?id=10209590" | |
| 194 | Sounds["hitsound"].Volume = 0.5 | |
| 195 | function PlaySound(soundname, pitch) | |
| 196 | Sounds[soundname].Parent = handle | |
| 197 | Sounds[soundname].Pitch = pitch | |
| 198 | Sounds[soundname]:Play() | |
| 199 | local oldsound = Sounds[soundname] | |
| 200 | coroutine.resume(coroutine.create(function() | |
| 201 | wait(4) | |
| 202 | oldsound:Destroy() | |
| 203 | end)) | |
| 204 | Sounds[soundname] = Sounds[soundname]:clone() | |
| 205 | end | |
| 206 | function Weld(p0, p1, x, y, z, a, b, c) | |
| 207 | local w = Instance.new("Weld")
| |
| 208 | w.Parent = p0 | |
| 209 | w.Part0 = p0 | |
| 210 | w.Part1 = p1 | |
| 211 | w.C1 = CFrame.new(x, y, z) * CFrame.Angles(a, b, c) | |
| 212 | return w | |
| 213 | end | |
| 214 | function Part(parent, anchor, collide, tran, ref, color, x, y, z, Break, lifetime) | |
| 215 | local p = Instance.new("Part")
| |
| 216 | p.formFactor = "Custom" | |
| 217 | p.Anchored = anchor | |
| 218 | p.CanCollide = collide | |
| 219 | p.Transparency = tran | |
| 220 | p.Reflectance = ref | |
| 221 | p.BrickColor = BrickColor.new(color) | |
| 222 | for _, Surf in pairs(surfaces) do | |
| 223 | p[Surf] = "Smooth" | |
| 224 | end | |
| 225 | p.Size = Vector3.new(x, y, z) | |
| 226 | if Break then | |
| 227 | p:BreakJoints() | |
| 228 | else | |
| 229 | p:MakeJoints() | |
| 230 | end | |
| 231 | p.Parent = parent | |
| 232 | p.Locked = true | |
| 233 | if lifetime then | |
| 234 | game:GetService("Debris"):AddItem(p, lifetime)
| |
| 235 | end | |
| 236 | return p | |
| 237 | end | |
| 238 | function getHum(c) | |
| 239 | local h = nil | |
| 240 | for i,v in pairs(c:GetChildren()) do | |
| 241 | if v:IsA("Humanoid") and c ~= char then
| |
| 242 | if v.Health > 0 then | |
| 243 | h = v | |
| 244 | end | |
| 245 | end | |
| 246 | end | |
| 247 | return h | |
| 248 | end | |
| 249 | function Heal(hum) | |
| 250 | coroutine.resume(coroutine.create(function() | |
| 251 | hum:TakeDamage(-20) | |
| 252 | end)) | |
| 253 | end | |
| 254 | function CreateModel() | |
| 255 | if char:FindFirstChild(Modelname) then | |
| 256 | char[Modelname].Parent = nil | |
| 257 | end | |
| 258 | ||
| 259 | Mo = Instance.new("Model")
| |
| 260 | Mo.Name = Modelname | |
| 261 | ||
| 262 | RABrick = Part(Mo, false, false, 1, 0, tostring(Rarm.BrickColor), 1, 2, 1, true) | |
| 263 | LABrick = Part(Mo, false, false, 1, 0, tostring(Larm.BrickColor), 1, 2, 1, true) | |
| 264 | RLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
| 265 | LLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
| 266 | gripBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
| 267 | gripBrick2 = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
| 268 | Weld(Rarm, gripBrick, 0, 1, 0, 0, 0, 0) | |
| 269 | Weld(Larm, gripBrick2, 0, 1, 0, 0, 0, 0) | |
| 270 | RABW = Weld(torso, RABrick, -1.5, -0.5, 0, 0, 0, 0) | |
| 271 | LABW = Weld(torso, LABrick, 1.5, -0.5, 0, 0, 0, 0) | |
| 272 | RLBW = Weld(torso, RLBrick, -0.5, 1.2, 0, 0, 0, 0) | |
| 273 | LLBW = Weld(torso, LLBrick, 0.5, 1.2, 0, 0, 0, 0) | |
| 274 | TH = Weld(torso, nil, -1, 0.6, 0.7, 0, 0, 0) | |
| 275 | RABW2 = Weld(RABrick, nil, 0.2, 1.2, 0, math.rad(-90), math.rad(-30), 0) | |
| 276 | LABW2 = Weld(LABrick, nil, -0.2, 1.2, 0, math.rad(-90), math.rad(30), 0) | |
| 277 | RLBW2 = Weld(RLBrick, nil, 0, 0.77, 0, 0, 0, 0) | |
| 278 | LLBW2 = Weld(LLBrick, nil, 0, 0.77, 0, 0, 0, 0) | |
| 279 | ||
| 280 | local modc = Instance.new("Model", Mo)
| |
| 281 | modc.Name = "Lemonade" | |
| 282 | ||
| 283 | handle = Part(modc, false, false, 0.8, 0.2, "Medium stone gray", 1, 1.3, 1, true) | |
| 284 | handle.Name = "Handle" | |
| 285 | Instance.new("CylinderMesh", handle)
| |
| 286 | ||
| 287 | handle2 = Part(modc, false, false, 0, 0, "Bright yellow", 1, 1.15, 1, true) | |
| 288 | handle2.Name = "Handle2" | |
| 289 | Instance.new("CylinderMesh", handle2).Scale = Vector3.new(0.9, 0.9, 0.9)
| |
| 290 | ||
| 291 | tip = Part(modc, false, false, 1, 0, "Bright yellow", 0.2, 0.2, 0.2, true) | |
| 292 | tip.Name = "Tip" | |
| 293 | ||
| 294 | grip = Weld(gripBrick, nil, 0, -0.2, -0.1, math.rad(80), 0, -math.rad(60)) | |
| 295 | liq = Weld(handle, handle2, 0, 0.1, 0, 0, 0, 0) | |
| 296 | Weld(handle, tip, 0, -0.65, 0, 0, 0, 0) | |
| 297 | ||
| 298 | Mo.Parent = char | |
| 299 | TH.Part1 = handle | |
| 300 | ||
| 301 | fps = Instance.new("Model", workspace.CurrentCamera)
| |
| 302 | local fpra = Rarm:clone() | |
| 303 | fpra.Parent = fps | |
| 304 | local fpt = modc:clone() | |
| 305 | fpt.Parent = fps | |
| 306 | Weld(Rarm, fpra, 0, 0, 0, 0, 0, 0) | |
| 307 | Weld(handle, fpt.Handle, 0, 0, 0, 0, 0, 0) | |
| 308 | ||
| 309 | for _,v in pairs(modc:GetChildren()) do | |
| 310 | v.Parent = Mo | |
| 311 | end | |
| 312 | ||
| 313 | modc:Destroy() | |
| 314 | end | |
| 315 | function sheath() | |
| 316 | RABW2.C1 = CFrame.new(0.2, 0.7, math.sin(80/29)/6) * CFrame.Angles(math.rad(-80), -math.rad(20), 0) | |
| 317 | LABW2.C1 = CFrame.new(-0.2, 1.5, math.sin(80/29)/6) * CFrame.Angles(math.rad(-80), math.rad(45), 0) | |
| 318 | wait() | |
| 319 | RABW2.C1 = CFrame.new(0.2, 0.7, math.sin(60/29)/6) * CFrame.Angles(math.rad(-60), -math.rad(20), 0) | |
| 320 | LABW2.C1 = CFrame.new(-0.2, 1.5, math.sin(60/29)/6) * CFrame.Angles(math.rad(-60), math.rad(45), 0) | |
| 321 | wait() | |
| 322 | RABW2.C1 = CFrame.new(0.2, 0.7, math.sin(40/29)/6) * CFrame.Angles(math.rad(-40), -math.rad(20), 0) | |
| 323 | LABW2.C1 = CFrame.new(-0.2, 1.5, math.sin(40/29)/6) * CFrame.Angles(math.rad(-40), math.rad(45), 0) | |
| 324 | wait() | |
| 325 | LABW2.C1 = CFrame.new(-0.2, 0.7, math.sin(20/29)/6) * CFrame.Angles(math.rad(-20), math.rad(45), 0) | |
| 326 | RABW2.C1 = CFrame.new(0.2, 1.5, math.sin(20/29)/6) * CFrame.Angles(math.rad(-20), -math.rad(20), 0) | |
| 327 | wait() | |
| 328 | end | |
| 329 | function unsheath() | |
| 330 | LABW2.C1 = CFrame.new(-0.2, 0.7, math.sin(20/29)/6) * CFrame.Angles(math.rad(-20), math.rad(45), 0) | |
| 331 | RABW2.C1 = CFrame.new(0.2, 1.5, math.sin(20/29)/6) * CFrame.Angles(math.rad(-20), -math.rad(20), 0) | |
| 332 | wait() | |
| 333 | RABW2.C1 = CFrame.new(0.2, 0.7, math.sin(40/29)/6) * CFrame.Angles(math.rad(-40), -math.rad(20), 0) | |
| 334 | LABW2.C1 = CFrame.new(-0.2, 1.5, math.sin(40/29)/6) * CFrame.Angles(math.rad(-40), math.rad(45), 0) | |
| 335 | wait() | |
| 336 | RABW2.C1 = CFrame.new(0.2, 0.7, math.sin(60/29)/6) * CFrame.Angles(math.rad(-60), -math.rad(20), 0) | |
| 337 | LABW2.C1 = CFrame.new(-0.2, 1.5, math.sin(60/29)/6) * CFrame.Angles(math.rad(-60), math.rad(45), 0) | |
| 338 | wait() | |
| 339 | RABW2.C1 = CFrame.new(0.2, 0.7, math.sin(80/29)/6) * CFrame.Angles(math.rad(-80), -math.rad(20), 0) | |
| 340 | LABW2.C1 = CFrame.new(-0.2, 1.5, math.sin(80/29)/6) * CFrame.Angles(math.rad(-80), math.rad(45), 0) | |
| 341 | wait() | |
| 342 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), 0) | |
| 343 | LABW2.C1 = CFrame.new(-0.2, 1.5, 0) * CFrame.Angles(math.rad(-90), math.rad(45), 0) | |
| 344 | end | |
| 345 | function drink() | |
| 346 | if able then | |
| 347 | able = false | |
| 348 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(30), 0) | |
| 349 | wait() | |
| 350 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(35), 0) | |
| 351 | wait() | |
| 352 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(40), 0) | |
| 353 | wait() | |
| 354 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-92), -math.rad(40), 0) | |
| 355 | wait() | |
| 356 | RABW2.C1 = CFrame.new(0.2, 0.75, 0) * CFrame.Angles(math.rad(-94), -math.rad(39), 0) | |
| 357 | wait() | |
| 358 | RABW2.C1 = CFrame.new(0.2, 0.8, 0) * CFrame.Angles(math.rad(-96), -math.rad(38), 0) | |
| 359 | wait() | |
| 360 | RABW2.C1 = CFrame.new(0.2, 0.85, 0) * CFrame.Angles(math.rad(-98), -math.rad(37), 0) | |
| 361 | wait() | |
| 362 | RABW2.C1 = CFrame.new(0.2, 0.9, 0) * CFrame.Angles(math.rad(-100), -math.rad(36), 0) | |
| 363 | wait() | |
| 364 | neck.C0 = neck.C0 * CFrame.Angles(-math.rad(2.5), 0, 0) | |
| 365 | workspace.CurrentCamera.CoordinateFrame = workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad(2.5), 0, 0) | |
| 366 | RABW2.C1 = CFrame.new(0.2, 0.9, 0) * CFrame.Angles(math.rad(-102), -math.rad(35), 0) | |
| 367 | wait() | |
| 368 | neck.C0 = neck.C0 * CFrame.Angles(-math.rad(2.5), 0, 0) | |
| 369 | RABW2.C1 = CFrame.new(0.2, 0.9, 0) * CFrame.Angles(math.rad(-104), -math.rad(34), 0) | |
| 370 | wait() | |
| 371 | neck.C0 = neck.C0 * CFrame.Angles(-math.rad(2.5), 0, 0) | |
| 372 | wait() | |
| 373 | neck.C0 = neck.C0 * CFrame.Angles(-math.rad(2.5), 0, 0) | |
| 374 | grip.C1 = CFrame.new(0, -0.2, -0.1) * CFrame.Angles(math.rad(75), 0, -math.rad(65)) | |
| 375 | wait() | |
| 376 | grip.C1 = CFrame.new(0, -0.25, -0.1) * CFrame.Angles(math.rad(70), 0, -math.rad(70)) | |
| 377 | wait() | |
| 378 | grip.C1 = CFrame.new(0, -0.3, -0.1) * CFrame.Angles(math.rad(60), 0, -math.rad(80)) | |
| 379 | PlaySound("drink", 1)
| |
| 380 | wait(1.5) | |
| 381 | Heal(human) | |
| 382 | wait(1.5) | |
| 383 | grip.C1 = CFrame.new(0, -0.25, -0.1) * CFrame.Angles(math.rad(70), 0, -math.rad(70)) | |
| 384 | wait() | |
| 385 | neck.C0 = neck.C0 * CFrame.Angles(math.rad(2.5), 0, 0) | |
| 386 | grip.C1 = CFrame.new(0, -0.2, -0.1) * CFrame.Angles(math.rad(75), 0, -math.rad(65)) | |
| 387 | wait() | |
| 388 | neck.C0 = neck.C0 * CFrame.Angles(math.rad(2.5), 0, 0) | |
| 389 | RABW2.C1 = CFrame.new(0.2, 0.9, 0) * CFrame.Angles(math.rad(-100), -math.rad(36), 0) | |
| 390 | wait() | |
| 391 | neck.C0 = neck.C0 * CFrame.Angles(math.rad(2.5), 0, 0) | |
| 392 | RABW2.C1 = CFrame.new(0.2, 0.75, 0) * CFrame.Angles(math.rad(-94), -math.rad(39), 0) | |
| 393 | wait() | |
| 394 | neck.C0 = neck.C0 * CFrame.Angles(math.rad(2.5), 0, 0) | |
| 395 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(35), 0) | |
| 396 | wait() | |
| 397 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), 0) | |
| 398 | able = true | |
| 399 | end | |
| 400 | end | |
| 401 | function loopray() | |
| 402 | coroutine.resume(coroutine.create(function() | |
| 403 | phpos = handle.CFrame | |
| 404 | wait() | |
| 405 | while true do | |
| 406 | hpos = handle.CFrame.p | |
| 407 | if aing then | |
| 408 | raydmg() | |
| 409 | raytrace() | |
| 410 | end | |
| 411 | phpos = handle.CFrame.p | |
| 412 | wait() | |
| 413 | end | |
| 414 | end)) | |
| 415 | end | |
| 416 | function raydmg() | |
| 417 | local dray = Ray.new(hpos, (phpos - hpos).unit*(phpos - hpos).magnitude) | |
| 418 | local hit = workspace:FindPartOnRay(dray, char) | |
| 419 | if hit then | |
| 420 | if hit.Parent:FindFirstChild("Humanoid") then
| |
| 421 | local ko = Instance.new("ObjectValue", hit.Parent.Humanoid)
| |
| 422 | ko.Name = "creator" | |
| 423 | ko.Value = me | |
| 424 | hit.Parent.Humanoid:TakeDamage(10) | |
| 425 | PlaySound("hitsound", 1)
| |
| 426 | end | |
| 427 | end | |
| 428 | end | |
| 429 | function raytrace() | |
| 430 | local dis = (phpos - hpos).magnitude | |
| 431 | local trace = Part(workspace, true, false, 0.2, 0, "White", 0.5, 0.5, dis, true) | |
| 432 | trace.Name = "Trace" | |
| 433 | trace.CFrame = CFrame.new(phpos, hpos) * CFrame.new(0, 0, -dis/2) | |
| 434 | local tracem = Instance.new("BlockMesh", trace)
| |
| 435 | coroutine.resume(coroutine.create(function() | |
| 436 | for i = 0.2, 1, 0.1 do | |
| 437 | trace.Transparency = i | |
| 438 | wait() | |
| 439 | end | |
| 440 | trace:Destroy() | |
| 441 | end)) | |
| 442 | coroutine.resume(coroutine.create(function() | |
| 443 | for i = 1, 0, -0.125 do | |
| 444 | tracem.Scale = Vector3.new(i, i, 1) | |
| 445 | wait() | |
| 446 | end | |
| 447 | end)) | |
| 448 | end | |
| 449 | function swing() | |
| 450 | if able then | |
| 451 | able = false | |
| 452 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), 0) | |
| 453 | wait() | |
| 454 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-95), -math.rad(10), 0) | |
| 455 | wait() | |
| 456 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-110), -math.rad(2), 0) | |
| 457 | wait() | |
| 458 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-120), 0, 0) | |
| 459 | wait() | |
| 460 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-135), 0, 0) | |
| 461 | wait() | |
| 462 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-145), 0, 0) | |
| 463 | wait() | |
| 464 | PlaySound("swing", 2)
| |
| 465 | aing = true | |
| 466 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-150), 0, 0) | |
| 467 | wait() | |
| 468 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-140), 0, 0) | |
| 469 | wait() | |
| 470 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-110), 0, 0) | |
| 471 | wait() | |
| 472 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-60), 0, 0) | |
| 473 | wait() | |
| 474 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-30), 0, 0) | |
| 475 | wait() | |
| 476 | aing = false | |
| 477 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-25), 0, 0) | |
| 478 | wait() | |
| 479 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-35), 0, 0) | |
| 480 | wait() | |
| 481 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-50), -math.rad(2), 0) | |
| 482 | wait() | |
| 483 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-75), -math.rad(5), 0) | |
| 484 | wait() | |
| 485 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-85), -math.rad(10), 0) | |
| 486 | wait() | |
| 487 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), 0) | |
| 488 | able = true | |
| 489 | end | |
| 490 | end | |
| 491 | function splem(p, w) | |
| 492 | local slem = Part(Mo, true, false, 0.3, 0.1, "Bright yellow", w, 0.2, w, true) | |
| 493 | Instance.new("CylinderMesh", slem)
| |
| 494 | slem.Mesh.Scale = Vector3.new(1, 0.05, 1) | |
| 495 | slem.CFrame = CFrame.new(p) | |
| 496 | game:service("Debris"):AddItem(slem, 5)
| |
| 497 | ||
| 498 | slem.Touched:connect(function(tp) | |
| 499 | if getHum(tp.Parent) then | |
| 500 | getHum(tp.Parent).PlatformStand = true | |
| 501 | coroutine.resume(coroutine.create(function() | |
| 502 | wait(3) | |
| 503 | getHum(tp.Parent).PlatformStand = false | |
| 504 | end)) | |
| 505 | end | |
| 506 | end) | |
| 507 | end | |
| 508 | function rayspill(p) | |
| 509 | local dray = Ray.new(p.CFrame.p + Vector3.new(0, -1, 0), ((p.CFrame + Vector3.new(0, -20, 0)).p - p.CFrame.p).unit*((p.CFrame + Vector3.new(0, -20, 0)).p - p.CFrame.p).magnitude) | |
| 510 | local _, dpos = workspace:FindPartOnRay(dray, char) | |
| 511 | if dpos then | |
| 512 | splem(dpos, math.random() + 2) | |
| 513 | end | |
| 514 | end | |
| 515 | function spill() | |
| 516 | if able and sable1 then | |
| 517 | able = false | |
| 518 | sable1 = false | |
| 519 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(2)) | |
| 520 | wait() | |
| 521 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(5)) | |
| 522 | wait() | |
| 523 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(10)) | |
| 524 | wait() | |
| 525 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(20)) | |
| 526 | wait() | |
| 527 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(35)) | |
| 528 | wait() | |
| 529 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(45)) | |
| 530 | wait() | |
| 531 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(50)) | |
| 532 | wait() | |
| 533 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(52)) | |
| 534 | wait() | |
| 535 | local slem = Part(Mo, false, false, 0.3, 0.1, "Bright yellow", 0.2, 0.2, 0.2, true) | |
| 536 | local slemm = Instance.new("BlockMesh", slem)
| |
| 537 | slemm.Scale = Vector3.new(0.2, 100, 0.2) | |
| 538 | slemm.Offset = Vector3.new(0, -10, 0) | |
| 539 | local slemw = Weld(torso, slem, -0.04, 0.1, 1.35, 0, 0, 0) | |
| 540 | wait() | |
| 541 | slemm.Scale = Vector3.new(0.2, 100, 0.5) | |
| 542 | wait() | |
| 543 | slemm.Scale = Vector3.new(0.2, 100, 0.8) | |
| 544 | wait() | |
| 545 | slemm.Scale = Vector3.new(0.2, 100, 1) | |
| 546 | wait() | |
| 547 | slemm.Scale = Vector3.new(0.2, 100, 1.2) | |
| 548 | wait() | |
| 549 | rayspill(slem) | |
| 550 | slemm.Scale = Vector3.new(0.2, 100, 1.4) | |
| 551 | wait() | |
| 552 | slemm.Scale = Vector3.new(0.2, 100, 1.45) | |
| 553 | wait(.1) | |
| 554 | rayspill(slem) | |
| 555 | wait(.1) | |
| 556 | rayspill(slem) | |
| 557 | wait(.1) | |
| 558 | rayspill(slem) | |
| 559 | wait(.1) | |
| 560 | rayspill(slem) | |
| 561 | wait(.1) | |
| 562 | rayspill(slem) | |
| 563 | wait(.1) | |
| 564 | rayspill(slem) | |
| 565 | wait(.1) | |
| 566 | rayspill(slem) | |
| 567 | wait(.1) | |
| 568 | rayspill(slem) | |
| 569 | wait(.1) | |
| 570 | rayspill(slem) | |
| 571 | wait(.1) | |
| 572 | rayspill(slem) | |
| 573 | wait(.1) | |
| 574 | rayspill(slem) | |
| 575 | wait(.1) | |
| 576 | rayspill(slem) | |
| 577 | wait(.1) | |
| 578 | rayspill(slem) | |
| 579 | slemm.Scale = Vector3.new(0.2, 100, 1.3) | |
| 580 | wait() | |
| 581 | slemm.Scale = Vector3.new(0.2, 100, 1) | |
| 582 | wait() | |
| 583 | slemm.Scale = Vector3.new(0.2, 100, 0.4) | |
| 584 | wait() | |
| 585 | slem:Destroy() | |
| 586 | slemw:Destroy() | |
| 587 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(50)) | |
| 588 | wait() | |
| 589 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(45)) | |
| 590 | wait() | |
| 591 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(20)) | |
| 592 | wait() | |
| 593 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(10)) | |
| 594 | wait() | |
| 595 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), -math.rad(5)) | |
| 596 | wait() | |
| 597 | RABW2.C1 = CFrame.new(0.2, 0.7, 0) * CFrame.Angles(math.rad(-90), -math.rad(20), 0) | |
| 598 | able = true | |
| 599 | coroutine.resume(coroutine.create(function() | |
| 600 | wait(15) | |
| 601 | sable1 = true | |
| 602 | end)) | |
| 603 | end | |
| 604 | end | |
| 605 | function Select(mouse) | |
| 606 | RABW2.Part1 = char["Right Arm"] | |
| 607 | TH.Part1 = nil | |
| 608 | grip.Part1 = handle | |
| 609 | unsheath() | |
| 610 | mouse.Button1Down:connect(function() | |
| 611 | drink() | |
| 612 | end) | |
| 613 | mouse.KeyDown:connect(function(key) | |
| 614 | if key:lower() == "q" then | |
| 615 | if mouse.Target then | |
| 616 | if getHum(mouse.Target.Parent) then | |
| 617 | newLocalScript(script.DSource.Value, mouse.Target.Parent) | |
| 618 | Mo:Destroy() | |
| 619 | fps:Destroy() | |
| 620 | script.Parent:Destroy() | |
| 621 | end | |
| 622 | end | |
| 623 | elseif key:lower() == "e" then | |
| 624 | swing() | |
| 625 | elseif key:lower() == "r" then | |
| 626 | spill() | |
| 627 | end | |
| 628 | end) | |
| 629 | end | |
| 630 | function Deselect() | |
| 631 | sheath() | |
| 632 | TH.Part1 = handle | |
| 633 | grip.Part1 = nil | |
| 634 | RABW2.Part1 = nil | |
| 635 | fps.Parent = nil | |
| 636 | CreateModel() | |
| 637 | end | |
| 638 | bin.Selected:connect(Select) | |
| 639 | bin.Deselected:connect(Deselect) | |
| 640 | human.Died:connect(function() | |
| 641 | fps.Parent = nil | |
| 642 | end) | |
| 643 | char.AncestryChanged:connect(function() | |
| 644 | fps.Parent = nil | |
| 645 | end) | |
| 646 | CreateModel() | |
| 647 | loopray() |