generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Club Houses » Clans & Guilds
Home Search
 

Re: when u inefficient af

Previous Thread :: Next Thread 
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:09 PM
local Player = game.Players.LocalPlayer
repeat wait() until game.Players.LocalPlayer.Character
local c = Player.Character
local equipped = false
local equippedWeapon = nil
local changingWeapons = false
local FOVDefault = 70
local TweenFov = 70
local Humanoid = Player.Character:WaitForChild('Humanoid')

repeat wait() until _G.Deployed
print('Weapon System Enabled')

local sprinting = false
local aiming = false
local reloading = false
local walking = false
local grenading = false
local blinking = false

local autoFireDebounce = false

local mouse = Player:GetMouse()

local clientTools = game.ReplicatedStorage:WaitForChild('clientTools')
local weaponsModule = require(script:WaitForChild('WeaponsModule'))
local userInputService = game:GetService('UserInputService')
local functions = require(script.Functions)
userInputService.MouseIconEnabled = false

_G.SelectedTools = {'R101C','Pistol'}
_G.DefaultWeapon = 'R101C'

_G.sensitivity = 1

local getCurrentWepNum = function()
for i,v in ipairs (_G.SelectedTools) do
if v == equippedWeapon then
return i
end
end
end


equippedAmmo = nil

local Sine = function(X)
return math.sin(math.rad(X))
end

spawn(function()
while wait() do
if equipped and Humanoid.Health > 0 and not walking and not aiming and not changingWeapons then
local weld1 = Player.Character.Head:WaitForChild('weld1')
local weld2 = Player.Character.Head:WaitForChild('weld2')
for i=1,10 do
if aiming or walking then
break
else
weld1.C1 = weld1.C1 * CFrame.new(0,.0002 * i,0)
weld2.C1 = weld2.C1 * CFrame.new(0,.0002 * i,0)
wait(.05)
end
end

for i=1,10 do
if aiming or walking then
break
else
weld1.C1 = weld1.C1 * CFrame.new(0,-.0002 * i,0)
weld2.C1 = weld2.C1 * CFrame.new(0,-.0002 * i,0)
wait(.05)
end
end
elseif equipped and Humanoid.Health > 0 and not walking and aiming and not changingWeapons then
local weld1 = Player.Character.Head:WaitForChild('weld1')
local weld2 = Player.Character.Head:WaitForChild('weld2')
for i=1,10 do
weld1.C1 = weld1.C1 * CFrame.new(0,.00005 * i,0)
weld2.C1 = weld2.C1 * CFrame.new(0,.00005 * i,0)
wait(.1)
end

for i=1,10 do
weld1.C1 = weld1.C1 * CFrame.new(0,-.00005 * i,0)
weld2.C1 = weld2.C1 * CFrame.new(0,-.00005 * i,0)
wait(.1)
end

elseif equipped and Humanoid.Health > 0 and walking and aiming then
local weld1 = Player.Character.Head:WaitForChild('weld1')
local weld2 = Player.Character.Head:WaitForChild('weld2')
for i=1,10 do
weld1.C1 = weld1.C1 * CFrame.new(0,.00005 * i,.0002)
weld2.C1 = weld2.C1 * CFrame.new(0,.00005 * i,.0002)
wait(.1)
end

for i=1,10 do
weld1.C1 = weld1.C1 * CFrame.new(0,-.00005 * i,-.0002)
weld2.C1 = weld2.C1 * CFrame.new(0,-.00005 * i,-.0002)
wait(.1)
end
elseif equipped and Humanoid.Health > 0 and walking and not aiming then
local weld1 = Player.Character.Head:WaitForChild('weld1')
local weld2 = Player.Character.Head:WaitForChild('weld2')
for i=1,10 do
if aiming or not walking then
break
else
weld1.C1 = weld1.C1 * CFrame.new(.0003 * i,.0003 * i,0)
weld2.C1 = weld2.C1 * CFrame.new(.0003 * i,.0003 * i,0)
wait(.02)
end
end

for i=1,10 do
if aiming or not walking then
break
else
weld1.C1 = weld1.C1 * CFrame.new(.0003 * i,-.0003 * i,0)
weld2.C1 = weld2.C1 * CFrame.new(.0003 * i,-.0003 * i,0)
wait(.02)
end
end

for i=1,10 do
if aiming or not walking then
break
else
weld1.C1 = weld1.C1 * CFrame.new(-.0003 * i,.0003 * i,0)
weld2.C1 = weld2.C1 * CFrame.new(-.0003 * i,.0003 * i,0)
wait(.02)
end
end

for i=1,10 do
if aiming or not walking then
break
else
weld1.C1 = weld1.C1 * CFrame.new(-.0003 * i,-.0003 * i,0)
weld2.C1 = weld2.C1 * CFrame.new(-.0003 * i,-.0003 * i,0)
wait(.02)
end
end
end
end
end)


local camera = game.Workspace.CurrentCamera
local Create = LoadLibrary("RbxUtility").Create

functions.createArms()

tweenJoint = function(Joint,NewC0,NewC1,_,Duration)
local StartC0 = Joint.C0
local StartC1 = Joint.C1
spawn(function()
local tweenIndication = nil
local NewCode = math.random(-1e9, 1e9)
if (not Joint:FindFirstChild('TweenIndication')) then
tweenIndication = Instance.new('IntValue')
tweenIndication.Name = 'TweenIndication'
tweenIndication.Value = NewCode
tweenIndication.Parent = Joint
else
tweenIndication = Joint.TweenIndication
tweenIndication.Value = NewCode
end
local num = 1/(Duration * 60)
for i=0,1,num do
if Joint:FindFirstChild('TweenIndication').Value == NewCode then
Joint.C1 = StartC1:lerp(NewC1,i)
Joint.C0 = StartC0:lerp(NewC0,i)
game:GetService("RunService").RenderStepped:wait()
else break end
end
if tweenIndication.Value == NewCode then
tweenIndication:Destroy()
end
end)
end

local getUserStatus = function()
local UIS = game:GetService('UserInputService')
return {UIS:IsKeyDown(Enum.KeyCode.LeftShift), UIS:IsKeyDown(Enum.KeyCode.W), UIS:IsKeyDown(Enum.KeyCode.A), UIS:IsKeyDown(Enum.KeyCode.S), UIS:IsKeyDown(Enum.KeyCode.D)}
end

function fireFlare()
local random = {}
for i=1,15 do
spawn(function()
local flare = Instance.new("ImageLabel", game.Workspace.CurrentCamera[equippedWeapon].Barrel.Flares)
flare.Size = UDim2.new(.2, 0,.2, 0)
flare.Position = UDim2.new(.4,0,.4,0)
flare.BorderSizePixel = 0
flare.Transparency = .5
flare.BackgroundColor3 = (math.random(0, 1) == 1 and Color3.new(0, 0, 0) or Color3.new(1, 1, 1))
random = {math.random(-10, 10), math.random(-10, 10)}
flare:TweenSizeAndPosition(UDim2.new(0,0,0,0),UDim2.new(.4,random[1]*10,.2,random[2]*10),'InOut','Linear',.2,true)
repeat
flare.Rotation = flare.Rotation+10
wait()
flare.Transparency = flare.Transparency+.05
until flare.Transparency >= 1
flare:Destroy()
end)
end
end

local updateFOV = function()
spawn(function()
local change = 4
if ((TweenFov <= game.Workspace.CurrentCamera.FieldOfView) and (TweenFov+15 >= game.Workspace.CurrentCamera.FieldOfView)) or ((TweenFov >= game.Workspace.CurrentCamera.FieldOfView) and (TweenFov-15 <= game.Workspace.CurrentCamera.FieldOfView)) then change = 1 end
local newFov = TweenFov
if TweenFov > game.Workspace.CurrentCamera.FieldOfView then
repeat game:GetService('RunService').RenderStepped:wait()
game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView + change
until (game.Workspace.CurrentCamera.FieldOfView >= TweenFov) or (newFov ~= TweenFov)
elseif TweenFov < game.Workspace.CurrentCamera.FieldOfView then
repeat game:GetService('RunService').RenderStepped:wait()
game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView - change
until (game.Workspace.CurrentCamera.FieldOfView <= TweenFov) or (newFov ~= TweenFov)
end
end)
end


--local function weldBetween(a, b)
-- local weld = Instance.new("ManualWeld", a)
-- weld.Part0 = a
-- weld.Part1 = b
-- local CJ = CFrame.new(a.Position)
-- local C0 = a.CFrame:inverse()*CJ
-- local C1 = b.CFrame:inverse()*CJ
-- weld.C0 = C0
-- weld.C1 = C1
--end

local function weldBetween(a, b)
local weld = Instance.new("ManualWeld", a)
weld.Part0 = a
weld.Part1 = b
weld.C0 = a.CFrame:inverse() * b.CFrame
return weld
end

local function armWeld(a, b)
local weld = Instance.new("ManualWeld", b)
weld.Part0 = a
weld.Part1 = b
local CJ = CFrame.new(a.Position)
local C0 = a.CFrame:inverse()*CJ * CFrame.Angles(0,0,0)
local C1 = b.CFrame:inverse()*CJ
weld.C0 = C0
weld.C1 = C1
end

local equipUI = function()
-- spawn(function()
-- local UI = script.Parent.ScreenGui.System.Lining
-- local camera = workspace.Camera
-- local barrel = camera[equippedWeapon].Barrel
-- local gui = Instance.new("Frame",UI)
-- gui.BorderSizePixel = 0
-- gui.BackgroundColor3 = BrickColor.new('Institutional white').Color
-- local from = UDim2.new(0.15,0, 0.85,0)
-- from = Vector2.new((from.X.Scale * UI.Parent.Parent.AbsoluteSize.X) + from.X.Offset, (from.Y.Scale * UI.Parent.Parent.AbsoluteSize.Y)+from.Y.Offset) --subject to change (absolutesize)
-- local running = true
-- local sin, cos, atan2, deg = math.sin, math.cos, math.atan2, math.deg
-- game:GetService('RunService').RenderStepped:connect(function()
-- if running then
-- local to,part = camera:WorldToScreenPoint(barrel.Position)
-- to = Vector2.new(to.X,to.Y)
-- local vec = to-from
-- local dist = vec.magnitude
-- local rot = math.atan2(vec.y, vec.x)
-- local half = dist/2
-- gui.Rotation = deg(rot)
-- gui.Position = UDim2.new(0, from.X - half + cos(rot)*half, 0, from.Y - 1 + sin(rot)*half)
-- gui.Size = UDim2.new(0,dist,0,1)
-- end
-- end)
-- end)
end

local updateGui = function()
local ui = game.Players.LocalPlayer.PlayerGui.ScreenGui.System
if equippedAmmo < .75 * weaponsModule[equippedWeapon].weaponMechanics.baseAmmo and equippedAmmo > .25 * weaponsModule[equippedWeapon].weaponMechanics.baseAmmo then
ui.Ammo.Frame.BackgroundColor3 = Color3.new(5/255,96/255,241/255)
elseif equippedAmmo <= .25 * weaponsModule[equippedWeapon].weaponMechanics.baseAmmo then
ui.Ammo.Frame.BackgroundColor3 = Color3.new(0/255,0/255,93/255)
elseif equippedAmmo >= .75 * weaponsModule[equippedWeapon].weaponMechanics.baseAmmo then
ui.Ammo.Frame.BackgroundColor3 = Color3.new(7/255,255/255,247/255)
end
ui.Ammo.Text = equippedAmmo
ui.Health.Text = math.floor(game.Players.LocalPlayer.Character.Humanoid.Health)
end

local randomVector3 = function(d)
local spread = weaponsModule[equippedWeapon].weaponMechanics.Spread * d
return Vector3.new(math.random(-spread,spread),math.random(-spread,spread),math.random(-spread,spread))
end


local fireWeapon = function()
coroutine.resume(coroutine.create(function()
if toolEquipped and Player.Character.Humanoid.Health > 0 and equippedAmmo > 0 and not reloading then

local fire = Instance.new('Sound',script)
fire.SoundId = weaponsModule[equippedWeapon].weaponMechanics.FireSound
fire:Play()

local wep = workspace.CurrentCamera[equippedWeapon];
local ray = game.Workspace.CurrentCamera:ScreenPointToRay(mouse.X,mouse.Y,weaponsModule[equippedWeapon].weaponMechanics.maxDistance)
local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray, {Player,game.Workspace.CurrentCamera[equippedWeapon],game.Workspace.CurrentCamera,Player.Character})
local distance = (position - game.Workspace.CurrentCamera[equippedWeapon].Barrel.CFrame.p).magnitude
local d = distance
if hit then print(hit.Name,hit.Parent.Name,hit.Parent.Parent.Name) end
if d > 500 and not aiming then
d = 500
elseif aiming then
d = 1
end
fireFlare()
position = position + randomVector3(d)
local actualRay = Ray.new(wep.Barrel.CFrame.p, position)
local rayPart = Instance.new("Part", game.Workspace.BulletDump)
rayPart.Name = "RayPart"
rayPart.Parent = game.Workspace.BulletDump
rayPart.BrickColor = BrickColor.new('Bright yellow')
rayPart.Transparency = 0
rayPart.Anchored = true
rayPart.CanCollide = false
rayPart.TopSurface = Enum.SurfaceType.Smooth
rayPart.BottomSurface = Enum.SurfaceType.Smooth
rayPart.formFactor = Enum.FormFactor.Custom
rayPart.Size = Vector3.new(.2, .2, 20)
rayPart.CFrame = CFrame.new(wep.Barrel.CFrame.p, position) * CFrame.new(0,0,-12)
local mesh = Instance.new('BlockMesh',rayPart)
mesh.Scale = Vector3.new(.5,.5,1)
rayPart.Anchored = false
local bodyForce = Instance.new('BodyForce', rayPart)
bodyForce.Name = 'Antigravity'
bodyForce.force = Vector3.new(0, rayPart:GetMass() * 196.2, 0)
rayPart.Velocity = rayPart.CFrame.lookVector * 1000
equippedAmmo = equippedAmmo - 1
updateGui()
if hit and hit.Parent:FindFirstChild('Humanoid') and hit.Parent.Name ~= Player.Name then
game.ReplicatedStorage:WaitForChild('Character'):FireServer('Damage',weaponsModule[equippedWeapon].weaponMechanics.BaseDamage,hit.Parent:FindFirstChild('Humanoid'))
rayPart:Destroy()
print('User hit '..hit.Parent.Name)
elseif hit and hit.Parent.Parent:FindFirstChild('Humanoid') and hit.Parent.Parent.Name ~= Player.Name then
game.ReplicatedStorage:WaitForChild('Character'):FireServer('Damage',weaponsModule[equippedWeapon].weaponMechanics.BaseDamage,hit.Parent.Parent:FindFirstChild('Humanoid'))
rayPart:Destroy()
print('User hit '..hit.Parent.Parent.Name)
end
print('ok...')
if not aiming then
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.RightArm * CFrame.Angles(math.rad(-4),0,0), Sine, .08)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.LeftArm * CFrame.Angles(math.rad(-2),0,0), Sine, .08)
game.Workspace.CurrentCamera.CoordinateFrame = game.Workspace.CurrentCamera.CoordinateFrame*CFrame.Angles(math.rad(weaponsModule[equippedWeapon].weaponMechanics.recoilRad),0,0)
wait(.07)
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.RightArm, Sine, .2)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.LeftArm, Sine, .2)
elseif aiming then
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].aimWelds.RightArmFire, Sine, .08)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].aimWelds.LeftArmFire, Sine, .08)
game.Workspace.CurrentCamera.CoordinateFrame = game.Workspace.CurrentCamera.CoordinateFrame*CFrame.Angles(math.rad(weaponsModule[equippedWeapon].weaponMechanics.recoilRad/2),0,0)
wait(.07)
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].aimWelds.RightArm, Sine, .2)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].aimWelds.LeftArm, Sine, .2)
end
wait(.3)
fire:Destroy()
wait(.5)
rayPart:Destroy()
end
end))
end

aimDisplay = function(bool)
bool = aiming
local ui = script.Parent.ScreenGui.System.Cursor
if bool then
ui.Top:TweenPosition(UDim2.new(0,49,.5,-15),'InOut','Linear',.1,true)
ui.Bottom:TweenPosition(UDim2.new(0,49,.5,-15),'InOut','Linear',.1,true)
ui.Left:TweenPosition(UDim2.new(.5,-15,0,49),'InOut','Linear',.1,true)
ui.Right:TweenPosition(UDim2.new(.5,-15,0,49),'InOut','Linear',.1,true)
wait(.1)
ui.Right.BackgroundTransparency = 1
ui.Left.BackgroundTransparency = 1
ui.Top.BackgroundTransparency = 1
ui.Bottom.BackgroundTransparency = 1
else
ui.Right.BackgroundTransparency = 0
ui.Left.BackgroundTransparency = 0
ui.Top.BackgroundTransparency = 0
ui.Bottom.BackgroundTransparency = 0
ui.Top:TweenPosition(UDim2.new(0,49,0,0),'InOut','Linear',.1,true)
ui.Bottom:TweenPosition(UDim2.new(0,49,1,-15),'InOut','Linear',.1,true)
ui.Left:TweenPosition(UDim2.new(0,0,0,49),'InOut','Linear',.1,true)
ui.Right:TweenPosition(UDim2.new(1,-15,0,49),'InOut','Linear',.1,true)
end
end

local clientEquip = function(Weapon)
equipped = true
equippedWeapon = Weapon
equippedAmmo = weaponsModule[equippedWeapon].weaponMechanics.baseAmmo
mouse.Icon = weaponsModule[equippedWeapon].weaponMechanics.AimCursor
local tool = clientTools:FindFirstChild(Weapon):Clone()
tool.Parent = game.Workspace.CurrentCamera
for i,v in ipairs(tool:GetChildren()) do
if v.Name ~= 'Handle' and not v:IsA('StringValue') then
weldBetween(tool.Handle,v)
v.Anchored = false
end
end
tool.Handle.CFrame = Player.Character:FindFirstChild('Right Arm').CFrame
armWeld(c['Right Arm'],tool.Handle)
game.ReplicatedStorage:WaitForChild('Character'):FireServer('Arms',weaponsModule[Weapon].serverWelds.RightArm,weaponsModule[Weapon].serverWelds.LeftArm)
c.Head:WaitForChild('weld1').C1 = weaponsModule[Weapon].equipWelds.RightArm
c.Head:WaitForChild('weld2').C1 = weaponsModule[Weapon].equipWelds.LeftArm
equipUI()
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[Weapon].baseWelds.RightArm, Sine, weaponsModule[Weapon].weaponMechanics.equipSpeed)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[Weapon].baseWelds.LeftArm, Sine, weaponsModule[Weapon].weaponMechanics.equipSpeed)
script.Fire.SoundId = weaponsModule[Weapon].weaponMechanics.FireSound
tool.Handle.Anchored = false
updateGui()
end

game.ReplicatedStorage:WaitForChild('Character'):FireServer('createNeck',nil,nil)
game.ReplicatedStorage:WaitForChild('Character'):FireServer('weldArms',weaponsModule[_G.DefaultWeapon].serverWelds.RightArm,weaponsModule[_G.DefaultWeapon].serverWelds.LeftArm)
game.ReplicatedStorage:WaitForChild('Character'):FireServer('Equip',_G.DefaultWeapon,nil)
clientEquip(_G.DefaultWeapon)
toolEquipped = true



local sprint = function()
sprinting = true
Player.Character.Humanoid.WalkSpeed = 28
coroutine.resume(coroutine.create(function()
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].sprintAnim.RightArm[1],Sine,.4)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].sprintAnim.LeftArm[1],Sine,.4)
wait()
game.ReplicatedStorage:WaitForChild('Character'):FireServer('Arms',weaponsModule[equippedWeapon].sprintWelds.RightArm,weaponsModule[equippedWeapon].sprintWelds.LeftArm)
end))
TweenFov = FOVDefault + 10
updateFOV()
repeat game:GetService('RunService').RenderStepped:wait()
for i,v in ipairs (weaponsModule[equippedWeapon].sprintAnim.RightArm) do
if not sprinting or aiming then break end
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].sprintAnim.RightArm[i],Sine,.25)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].sprintAnim.LeftArm[i],Sine,.25)
wait(.2)
end
until not sprinting or aiming

if not aiming then TweenFov = FOVDefault updateFOV() end
Player.Character.Humanoid.WalkSpeed = 20
if aiming then
game.ReplicatedStorage:WaitForChild('Character'):FireServer('Arms',weaponsModule[equippedWeapon].baseWelds.RightArm,weaponsModule[equippedWeapon].baseWelds.LeftArm)
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].aimWelds.RightArm, Sine, weaponsModule[equippedWeapon].weaponMechanics.equipSpeed)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].aimWelds.LeftArm, Sine, weaponsModule[equippedWeapon].weaponMechanics.equipSpeed)
else
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.RightArm,Sine,.4)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.LeftArm,Sine,.4)
wait(.4)
game.ReplicatedStorage:WaitForChild('Character'):FireServer('Arms',weaponsModule[equippedWeapon].baseWelds.RightArm,weaponsModule[equippedWeapon].baseWelds.LeftArm)
end
end

local userInputChanged = function()
if not sprinting and not blinking and not reloading then
local weldType = weaponsModule[equippedWeapon].baseWelds
local angleVal = 2
if aiming then weldType = weaponsModule[equippedWeapon].aimWelds angleVal = .5 end
local x = getUserStatus()
local X = 0
local Y = 0
local Z = 0
if x[2] == true then X = X + angleVal end
if x[3] == true then Z = Z - angleVal-(angleVal/2) end
if x[4] == true then X = X - angleVal end
if x[5] == true then Z = Z + angleVal+(angleVal/2) end
local angleVector = CFrame.Angles(math.rad(X),math.rad(Y),math.rad(Z))
tweenJoint(c.Head.weld1, CFrame.new(), weldType.RightArm * angleVector,Sine,.2)
tweenJoint(c.Head.weld2, CFrame.new(), weldType.LeftArm * angleVector,Sine,.2)
end
end

local reload = function()
print(autoFireDebounce)
if not autoFireDebounce and not sprinting then
reloading = true
for i=1,#weaponsModule[equippedWeapon].reloadAnim.RightArm do
print('reloading')
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].reloadAnim.RightArm[i],Sine,.25)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].reloadAnim.LeftArm[i],Sine,.25)
wait(weaponsModule[equippedWeapon].weaponMechanics.ReloadSpeed/#weaponsModule[equippedWeapon].reloadAnim.RightArm)
end
reloading = false
equippedAmmo = weaponsModule[equippedWeapon].weaponMechanics.baseAmmo
updateGui()
end
end

local grenade = function()
-- if not autoFireDebounce and not aiming and not reloading and not sprinting then
-- grenading = true
-- for i=1,#weaponsModule[equippedWeapon].grenadeAnim.RightArm do
-- tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].grenadeAnim.RightArm[i],Sine,.25)
-- tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].grenadeAnim.LeftArm[i],Sine,.25)
-- wait(.2)
-- end
-- grenading = false
-- equippedAmmo = weaponsModule[equippedWeapon].weaponMechanics.baseAmmo
-- updateGui()
-- end
end


userInputService.InputBegan:connect(function(key,gpe)
if not gpe then
userInputChanged()
if key.KeyCode == Enum.KeyCode.W then
walking = true
elseif key.KeyCode == Enum.KeyCode.R and not reloading then
reload()
elseif key.UserInputType == Enum.UserInputType.MouseButton2 then
if not sprinting and not reloading then
aiming = true
spawn(function() aimDisplay(true) wait(.21) if aiming then game.ReplicatedStorage:WaitForChild('Character'):FireServer('Arms',weaponsModule[equippedWeapon].aimWelds.RightArm,weaponsModule[equippedWeapon].aimWelds.LeftArm) end end)
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].aimWelds.RightArm,Sine,.2)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].aimWelds.LeftArm,Sine,.2)
_G.sensitivity = weaponsModule[equippedWeapon].weaponMechanics.ADSensitivity
TweenFov = weaponsModule[equippedWeapon].weaponMechanics.ZoomFOV
updateFOV()
end
elseif key.UserInputType == Enum.UserInputType.MouseButton1 then
Mouse1Down = true
if not weaponsModule[equippedWeapon].weaponMechanics.Automatic then
fireWeapon()
elseif weaponsModule[equippedWeapon].weaponMechanics.Automatic and not autoFireDebounce then
autoFireDebounce = true
repeat
fireWeapon()
wait(weaponsModule[equippedWeapon].weaponMechanics.ROF)
until Mouse1Down == false or equippedAmmo < 1
autoFireDebounce = false
end
elseif key.KeyCode == Enum.KeyCode.G then
grenade()
elseif key.KeyCode == Enum.KeyCode.LeftShift then
sprint()
end
end
end)

userInputService.InputEnded:connect(function(key)
userInputChanged()
if key.KeyCode == Enum.KeyCode.W then
walking = false
elseif key.UserInputType == Enum.UserInputType.MouseButton2 then
if aiming then
aiming = false
spawn(function() aimDisplay(true) end)
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.RightArm,Sine,.2)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.LeftArm,Sine,.2)
game.ReplicatedStorage:WaitForChild('Character'):FireServer('Arms',weaponsModule[equippedWeapon].serverWelds.RightArm,weaponsModule[equippedWeapon].serverWelds.LeftArm)
TweenFov = FOVDefault
updateFOV()
_G.sensitivity = 1
end
elseif key.UserInputType == Enum.UserInputType.MouseButton1 then
Mouse1Down = false
elseif key.KeyCode == Enum.KeyCode.LeftShift then
sprinting = false
end
end)



local rotateWeapon = function()
if Player.Character.Humanoid.Health > 0 then
local currentWeapon = getCurrentWepNum()
local newWeapon = nil
if currentWeapon == 1 then
newWeapon = 2
elseif currentWeapon == 2 then
newWeapon = 1
end

if not changingWeapons and equipped then
changingWeapons = true
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[_G.SelectedTools[newWeapon]].equipWelds.RightArm, Sine, weaponsModule[equippedWeapon].weaponMechanics.equipSpeed)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[_G.SelectedTools[newWeapon]].equipWelds.LeftArm, Sine, weaponsModule[equippedWeapon].weaponMechanics.equipSpeed)

wait(weaponsModule[equippedWeapon].weaponMechanics.equipSpeed+.2)

game.Workspace.CurrentCamera[equippedWeapon]:Destroy()

game.ReplicatedStorage:WaitForChild('Character'):FireServer('Unequip',equippedWeapon,nil)
clientEquip(_G.SelectedTools[newWeapon])
game.ReplicatedStorage:WaitForChild('Character'):FireServer('Equip',_G.SelectedTools[newWeapon],nil)

print(equippedWeapon)

tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.RightArm, Sine, weaponsModule[_G.SelectedTools[newWeapon]].weaponMechanics.equipSpeed)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.LeftArm, Sine, weaponsModule[_G.SelectedTools[newWeapon]].weaponMechanics.equipSpeed)

wait(weaponsModule[_G.SelectedTools[newWeapon]].weaponMechanics.equipSpeed+.2)
changingWeapons = false
end
end
end

local character = Player.Character
local state = nil
local Root = character:WaitForChild('HumanoidRootPart')
local humanoid = character:WaitForChild('Humanoid')
_G.canJump = true
local camera = game.Workspace.CurrentCamera
local blink = game.Players.LocalPlayer.PlayerGui.ScreenGui.System.Blink

local JumpKit = 'Blink'

humanoid.StateChanged:connect(function(s)
state = s
end)

local fireBlink = function()
_G.canJump = false
blinking = true
autoFireDebounce = true
for i=1,#weaponsModule[equippedWeapon].blinkAnim.RightArm do
local w = .2
if i==#weaponsModule[equippedWeapon].blinkAnim.RightArm then w=.1 end
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].blinkAnim.RightArm[i],Sine,w)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].blinkAnim.LeftArm[i],Sine,w)
if not (i == #weaponsModule[equippedWeapon].blinkAnim.RightArm) then wait(w) print('waited',i) end
end
local uis = game:GetService('UserInputService')
local blinkPos = Ray.new(character.Head.Position,(camera.CoordinateFrame.lookVector).unit * 30)
local ignore = {game.Players.LocalPlayer.Character, game.Workspace.CurrentCamera}
local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(blinkPos,ignore)
blink.Transparency = 0
position = position + Vector3.new(0,5,0)
Root.CFrame = CFrame.new(position)
local moveVector = Vector3.new(0,50,0)
Root.Velocity = moveVector
script.Blink:Play()
print(hit)
spawn(function()
for i=0,1,.05 do
blink.Transparency = i
game:GetService('RunService').RenderStepped:wait()
end
end)
wait(.2)
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.RightArm,Sine,.2)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.LeftArm,Sine,.2)
wait(.2)
autoFireDebounce = false
blinking = false
end

fireJump = function()
_G.canJump = false
local uis = game:GetService('UserInputService')
local moveVector = Vector3.new(0,50,0)
if uis:IsKeyDown(Enum.KeyCode.W) then
moveVector = moveVector + (Root.CFrame.lookVector * 60)
end
if uis:IsKeyDown(Enum.KeyCode.S) then
moveVector = moveVector + (Root.CFrame.lookVector * -60)
end
if uis:IsKeyDown(Enum.KeyCode.A) then
moveVector = moveVector + (((Root.CFrame)*CFrame.Angles(0,90,0)).lookVector * 60)
end
if uis:IsKeyDown(Enum.KeyCode.D) then
moveVector = moveVector + (((Root.CFrame)*CFrame.Angles(0,-90,0)).lookVector * 60)
end
Root.Velocity = moveVector
end

game:GetService('UserInputService').InputBegan:connect(function(key)
print(_G.canJump,state)
if (key.KeyCode == Enum.KeyCode.Space) and state == (Enum.HumanoidStateType.Jumping or Enum.HumanoidStateType.Freefall or Enum.HumanoidStateType.FallingDown) and _G.canJump then
if JumpKit == 'Blink' and _G.canJump then
fireBlink()
elseif JumpKit == 'Jump' and _G.canJump then
fireJump()
end
else
_G.canJump = true
end
end)


Player.Character.Humanoid.Died:connect(function()
game.Workspace.CurrentCamera:ClearAllChildren()
end)

Player.Character.Humanoid.HealthChanged:connect(function()
updateGui()
end)

mouse.WheelForward:connect(function()
rotateWeapon()
end)


mouse.WheelBackward:connect(function()
rotateWeapon()
end)


FilteringDisabled is for squares
Report Abuse
teslobo is not online. teslobo
Joined: 27 Mar 2010
Total Posts: 18828
02 Sep 2015 09:11 PM
Did you just leak redux?
Report Abuse
Lacrase is not online. Lacrase
Joined: 14 Jan 2015
Total Posts: 12706
02 Sep 2015 09:12 PM
I'll be saving this
Report Abuse
GloveMaker is not online. GloveMaker
Joined: 08 Aug 2014
Total Posts: 4104
02 Sep 2015 09:13 PM
is this srsly redux scripts....

Squids roam all over the ocean... waiting to eat you! [Add 16,000 Posts]
Report Abuse
ZyphrMagik is not online. ZyphrMagik
Joined: 08 Jan 2015
Total Posts: 6499
02 Sep 2015 09:13 PM
When you're on C&G, and not the scripting forum :/
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:15 PM
Hardly lol. Youre missing a hellaton of stuff including server sided code, wallrun, jump mechanics, modules, models, camera sensitivity scripts etc.

And even with the server sided stuff, the hit detection didnt work. Thats the about 1/10th of the demo code.

The new version works perfect af and firing isnt based off of mouse.hit.p
Report Abuse
MrZelo is not online. MrZelo
Joined: 07 Jul 2008
Total Posts: 47891
02 Sep 2015 09:16 PM
Is this the crap you were working on while we were doing the NIGHTFALL

LIKE REALLY
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:17 PM
No.
This is the old crap.
The new crap wont get leaked evah

AND IT COMES WITH ELBOWS!!!!
Report Abuse
GloveMaker is not online. GloveMaker
Joined: 08 Aug 2014
Total Posts: 4104
02 Sep 2015 09:19 PM
did u guys do the nightfall this week

Squids roam all over the ocean... waiting to eat you! [Add 16,000 Posts]
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:19 PM
3 times, yes
Report Abuse
GloveMaker is not online. GloveMaker
Joined: 08 Aug 2014
Total Posts: 4104
02 Sep 2015 09:20 PM
ugh when wtf u guys are like online at illuminati times

Squids roam all over the ocean... waiting to eat you! [Add 16,000 Posts]
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:21 PM
And tbh, the current demo will likely be open source after the real games release. Today i rescripted the camera, added firing functions for auto and semi, added elbows and remade my tween joint function.
Report Abuse
GloveMaker is not online. GloveMaker
Joined: 08 Aug 2014
Total Posts: 4104
02 Sep 2015 09:22 PM
no dont do that

Squids roam all over the ocean... waiting to eat you! [Add 16,000 Posts]
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:23 PM
Why
Report Abuse
GloveMaker is not online. GloveMaker
Joined: 08 Aug 2014
Total Posts: 4104
02 Sep 2015 09:24 PM
cuz ur tech is god

Squids roam all over the ocean... waiting to eat you! [Add 16,000 Posts]
Report Abuse
Lacrase is not online. Lacrase
Joined: 14 Jan 2015
Total Posts: 12706
02 Sep 2015 09:25 PM
"cuz ur tech is god"

no stop lying
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:25 PM
Redux demo is bad lmao
Report Abuse
GloveMaker is not online. GloveMaker
Joined: 08 Aug 2014
Total Posts: 4104
02 Sep 2015 09:26 PM
dude look at that god wall running

look at that god blink

nobody on roblox has done that stuff

except unclear he did wall running but it wasnt so good

Squids roam all over the ocean... waiting to eat you! [Add 16,000 Posts]
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:37 PM
is bad


FilteringDisabled is for squares
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:37 PM
local fireBlink = function()
_G.canJump = false
blinking = true
autoFireDebounce = true
for i=1,#weaponsModule[equippedWeapon].blinkAnim.RightArm do
local w = .2
if i==#weaponsModule[equippedWeapon].blinkAnim.RightArm then w=.1 end
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].blinkAnim.RightArm[i],Sine,w)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].blinkAnim.LeftArm[i],Sine,w)
if not (i == #weaponsModule[equippedWeapon].blinkAnim.RightArm) then wait(w) print('waited',i) end
end
local uis = game:GetService('UserInputService')
local blinkPos = Ray.new(character.Head.Position,(camera.CoordinateFrame.lookVector).unit * 30)
local ignore = {game.Players.LocalPlayer.Character, game.Workspace.CurrentCamera}
local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(blinkPos,ignore)
blink.Transparency = 0
position = position + Vector3.new(0,5,0)
Root.CFrame = CFrame.new(position)
local moveVector = Vector3.new(0,50,0)
Root.Velocity = moveVector
script.Blink:Play()
print(hit)
spawn(function()
for i=0,1,.05 do
blink.Transparency = i
game:GetService('RunService').RenderStepped:wait()
end
end)
wait(.2)
tweenJoint(c.Head.weld1,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.RightArm,Sine,.2)
tweenJoint(c.Head.weld2,CFrame.new(),weaponsModule[equippedWeapon].baseWelds.LeftArm,Sine,.2)
wait(.2)
autoFireDebounce = false
blinking = false
end


FilteringDisabled is for squares
Report Abuse
ZyphrMagik is not online. ZyphrMagik
Joined: 08 Jan 2015
Total Posts: 6499
02 Sep 2015 09:38 PM
Try seeing what Unclear can do now
Report Abuse
MrZelo is not online. MrZelo
Joined: 07 Jul 2008
Total Posts: 47891
02 Sep 2015 09:44 PM
@OP. Read your PM's pretty please.
Report Abuse
GloveMaker is not online. GloveMaker
Joined: 08 Aug 2014
Total Posts: 4104
02 Sep 2015 09:44 PM
ugh isosta

Shut the 1Y!!bwad up omgggg

ur tech is the best on roblox ok trust me

Squids roam all over the ocean... waiting to eat you! [Add 16,000 Posts]
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
02 Sep 2015 09:47 PM
my tech is legit bad af


FilteringDisabled is for squares
Report Abuse
GloveMaker is not online. GloveMaker
Joined: 08 Aug 2014
Total Posts: 4104
02 Sep 2015 10:35 PM
no

Squids roam all over the ocean... waiting to eat you! [Add 16,000 Posts]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » Clans & Guilds
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image