Unknown
LEAK Btools SS replication Super trash gui work on btools
- Views
- 32K
- Likes
- 3
- Dislikes
- 0
- Added
Script
--skibidi
local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
local dragtitle = Instance.new("TextLabel")
local xr6 = Instance.new("TextButton")
local dynr6 = Instance.new("TextButton")
local visr6 = Instance.new("TextButton")
local freemanr6 = Instance.new("TextButton")
local soldierr6 = Instance.new("TextButton")
local TextLabel = Instance.new("TextLabel")
local TextLabel_2 = Instance.new("TextLabel")
local xr15 = Instance.new("TextButton")
local dynr15 = Instance.new("TextButton")
local freemanr15 = Instance.new("TextButton")
local control = Instance.new("TextButton")
local controlstext = Instance.new("TextBox")
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
ScreenGui.ResetOnSpawn = false
Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.fromRGB(36, 36, 36)
Frame.BackgroundTransparency = 0.200
Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
Frame.BorderSizePixel = 0
Frame.Position = UDim2.new(0.399260223, 0, 0.176146001, 0)
Frame.Size = UDim2.new(0, 185, 0, 304)
dragtitle.Name = "dragtitle"
dragtitle.Parent = Frame
dragtitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
dragtitle.BackgroundTransparency = 1.000
dragtitle.BorderColor3 = Color3.fromRGB(0, 0, 0)
dragtitle.BorderSizePixel = 0
dragtitle.Size = UDim2.new(0, 185, 0, 21)
dragtitle.Font = Enum.Font.SourceSansItalic
dragtitle.Text = "Super trash gui"
dragtitle.TextColor3 = Color3.fromRGB(255, 255, 255)
dragtitle.TextScaled = true
dragtitle.TextSize = 14.000
dragtitle.TextWrapped = true
xr6.Name = "xr6"
xr6.Parent = Frame
xr6.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
xr6.BackgroundTransparency = 0.700
xr6.BorderColor3 = Color3.fromRGB(0, 0, 0)
xr6.BorderSizePixel = 0
xr6.Position = UDim2.new(0.0378378369, 0, 0.148026317, 0)
xr6.Size = UDim2.new(0, 148, 0, 18)
xr6.Font = Enum.Font.SourceSansItalic
xr6.Text = "Xester (R6)"
xr6.TextColor3 = Color3.fromRGB(255, 255, 255)
xr6.TextScaled = true
xr6.TextSize = 14.000
xr6.TextWrapped = true
dynr6.Name = "dynr6"
dynr6.Parent = Frame
dynr6.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
dynr6.BackgroundTransparency = 0.700
dynr6.BorderColor3 = Color3.fromRGB(0, 0, 0)
dynr6.BorderSizePixel = 0
dynr6.Position = UDim2.new(0.0378378369, 0, 0.240131572, 0)
dynr6.Size = UDim2.new(0, 148, 0, 18)
dynr6.Font = Enum.Font.SourceSansItalic
dynr6.Text = "Dynamite (R6)"
dynr6.TextColor3 = Color3.fromRGB(255, 255, 255)
dynr6.TextScaled = true
dynr6.TextSize = 14.000
dynr6.TextWrapped = true
visr6.Name = "visr6"
visr6.Parent = Frame
visr6.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
visr6.BackgroundTransparency = 0.700
visr6.BorderColor3 = Color3.fromRGB(0, 0, 0)
visr6.BorderSizePixel = 0
visr6.Position = UDim2.new(0.0378378369, 0, 0.335526317, 0)
visr6.Size = UDim2.new(0, 148, 0, 18)
visr6.Font = Enum.Font.SourceSansItalic
visr6.Text = "Visualizer (R6)"
visr6.TextColor3 = Color3.fromRGB(255, 255, 255)
visr6.TextScaled = true
visr6.TextSize = 14.000
visr6.TextWrapped = true
freemanr6.Name = "freemanr6"
freemanr6.Parent = Frame
freemanr6.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
freemanr6.BackgroundTransparency = 0.700
freemanr6.BorderColor3 = Color3.fromRGB(0, 0, 0)
freemanr6.BorderSizePixel = 0
freemanr6.Position = UDim2.new(0.0378378369, 0, 0.430921048, 0)
freemanr6.Size = UDim2.new(0, 148, 0, 18)
freemanr6.Font = Enum.Font.SourceSansItalic
freemanr6.Text = "Freeman (R6)"
freemanr6.TextColor3 = Color3.fromRGB(255, 255, 255)
freemanr6.TextScaled = true
freemanr6.TextSize = 14.000
freemanr6.TextWrapped = true
soldierr6.Name = "soldierr6"
soldierr6.Parent = Frame
soldierr6.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
soldierr6.BackgroundTransparency = 0.700
soldierr6.BorderColor3 = Color3.fromRGB(0, 0, 0)
soldierr6.BorderSizePixel = 0
soldierr6.Position = UDim2.new(0.0378378369, 0, 0.523026288, 0)
soldierr6.Size = UDim2.new(0, 148, 0, 18)
soldierr6.Font = Enum.Font.SourceSansItalic
soldierr6.Text = "Soldier NPC (r6) half broken"
soldierr6.TextColor3 = Color3.fromRGB(255, 255, 255)
soldierr6.TextScaled = true
soldierr6.TextSize = 14.000
soldierr6.TextWrapped = true
TextLabel.Parent = Frame
TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.BackgroundTransparency = 1.000
TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
TextLabel.BorderSizePixel = 0
TextLabel.Position = UDim2.new(0, 0, 0.0789473653, 0)
TextLabel.Size = UDim2.new(0, 185, 0, 21)
TextLabel.Font = Enum.Font.SourceSansItalic
TextLabel.Text = "R6 "
TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.TextScaled = true
TextLabel.TextSize = 14.000
TextLabel.TextWrapped = true
TextLabel_2.Parent = Frame
TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel_2.BackgroundTransparency = 1.000
TextLabel_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
TextLabel_2.BorderSizePixel = 0
TextLabel_2.Position = UDim2.new(0, 0, 0.582236826, 0)
TextLabel_2.Size = UDim2.new(0, 185, 0, 21)
TextLabel_2.Font = Enum.Font.SourceSansItalic
TextLabel_2.Text = "R15"
TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
TextLabel_2.TextScaled = true
TextLabel_2.TextSize = 14.000
TextLabel_2.TextWrapped = true
xr15.Name = "xr15"
xr15.Parent = Frame
xr15.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
xr15.BackgroundTransparency = 0.700
xr15.BorderColor3 = Color3.fromRGB(0, 0, 0)
xr15.BorderSizePixel = 0
xr15.Position = UDim2.new(0.0378378369, 0, 0.677631557, 0)
xr15.Size = UDim2.new(0, 148, 0, 18)
xr15.Font = Enum.Font.SourceSansItalic
xr15.Text = "Xester (R15)"
xr15.TextColor3 = Color3.fromRGB(255, 255, 255)
xr15.TextScaled = true
xr15.TextSize = 14.000
xr15.TextWrapped = true
dynr15.Name = "dynr15"
dynr15.Parent = Frame
dynr15.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
dynr15.BackgroundTransparency = 0.700
dynr15.BorderColor3 = Color3.fromRGB(0, 0, 0)
dynr15.BorderSizePixel = 0
dynr15.Position = UDim2.new(0.0378378369, 0, 0.769736826, 0)
dynr15.Size = UDim2.new(0, 148, 0, 18)
dynr15.Font = Enum.Font.SourceSansItalic
dynr15.Text = "Dynamite (R15)"
dynr15.TextColor3 = Color3.fromRGB(255, 255, 255)
dynr15.TextScaled = true
dynr15.TextSize = 14.000
dynr15.TextWrapped = true
freemanr15.Name = "freemanr15"
freemanr15.Parent = Frame
freemanr15.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
freemanr15.BackgroundTransparency = 0.700
freemanr15.BorderColor3 = Color3.fromRGB(0, 0, 0)
freemanr15.BorderSizePixel = 0
freemanr15.Position = UDim2.new(0.0378378369, 0, 0.858552635, 0)
freemanr15.Size = UDim2.new(0, 148, 0, 18)
freemanr15.Font = Enum.Font.SourceSansItalic
freemanr15.Text = "Freeman (R15)"
freemanr15.TextColor3 = Color3.fromRGB(255, 255, 255)
freemanr15.TextScaled = true
freemanr15.TextSize = 14.000
freemanr15.TextWrapped = true
control.Name = "control"
control.Parent = Frame
control.BackgroundColor3 = Color3.fromRGB(16, 16, 16)
control.BorderColor3 = Color3.fromRGB(0, 0, 0)
control.BorderSizePixel = 0
control.Position = UDim2.new(0.870270252, 0, 0.0394736826, 0)
control.Size = UDim2.new(0, 24, 0, 279)
control.Font = Enum.Font.SourceSans
control.Text = "CONTROLS"
control.TextColor3 = Color3.fromRGB(255, 255, 255)
control.TextSize = 14.000
controlstext.Name = "controlstext"
controlstext.Parent = Frame
controlstext.BackgroundColor3 = Color3.fromRGB(36, 36, 36)
controlstext.BackgroundTransparency = 0.200
controlstext.BorderColor3 = Color3.fromRGB(0, 0, 0)
controlstext.BorderSizePixel = 0
controlstext.Position = UDim2.new(1, 0, 0.0690789446, 0)
controlstext.Size = UDim2.new(0, 250, 0, 246)
controlstext.Visible = false
controlstext.ClearTextOnFocus = false
controlstext.Font = Enum.Font.SourceSans
controlstext.MultiLine = true
controlstext.Text = "XESTER: C -Big slam card, B - Card storm, V - blackhole card (click on any place on map to tp the blackhole card to) DO NOT USE ANY OTHER MOVES WHEN USING ONE!; Dynamite: C - Drop the dynamite and touch it to activate it;;; Freeman: C - Switch to FPV arms mode, V - Crowbar, B - Gun, Z (or is it X) - RPG;;; Soldier NPC: Kills everything in distance (be away from soldier so it kills others);;; Visualizer: big ass rotating cube under ur character like banisher type of shid;;;"
controlstext.TextColor3 = Color3.fromRGB(254, 254, 254)
controlstext.TextScaled = true
controlstext.TextSize = 14.000
controlstext.TextWrapped = true
print("watermark of 74235 yes yes yes super trash gui is MINE, however you can skid it as much as you want, im not good at lua so i've used least of my knowledge to make this, thank you");
local function doxesterr6()
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local char = LocalPlayer.Character
local Event = LocalPlayer.Backpack:FindFirstChild("Building Tools").SyncAPI.ServerEndpoint
local UIS = game:GetService("UserInputService")
local function CreatePart(position,parent)
Event:InvokeServer("CreatePart", "Normal", position, parent)
end
local function CreateBall(position,parent)
Event:InvokeServer("CreatePart", "Ball", position, parent)
end
--workspace.Part
local function CreateMesh(part,meshid)
local args = {
[1] = "CreateMeshes",
[2] = {
[1] = {
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["MeshType"] = Enum.MeshType.FileMesh,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["MeshId"] = meshid
}
}
}
Event:InvokeServer(unpack(args))
end
local function CanCollide(part,cancollide)
local args = {
[1] = "SyncCollision",
[2] = {
[1] = {
["Part"] = part,
["CanCollide"] = cancollide
}
}
}
Event:InvokeServer(unpack(args))
end
local function Anchor(part,anchor)
local args = {
[1] = "SyncAnchor",
[2] = {
[1] = {
["Part"] = part,
["Anchored"] = anchor
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rotate(part,degreex,degreey,degreez,anglesx,anglesy,anglesz)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = CFrame.new(degreex, degreey, degreez) * CFrame.Angles(anglesx, anglesy,anglesz)
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshSize(part,vector3size)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["Scale"] = vector3size
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeTransparency(part,transparency)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Transparency"] = transparency
}
}
}
Event:InvokeServer(unpack(args))
end
local function WeldTo(parttoweld,parttoweldto)
local args = {
[1] = "CreateWelds",
[2] = {
[1] = parttoweld
},
[3] = parttoweldto
}
Event:InvokeServer(unpack(args))
end
local function BreakWeld(weldtobreak)
local args = {
[1] = "RemoveWelds",
[2] = {weldtobreak}
}
Event:InvokeServer(unpack(args))
end
local function MovePart(part,cframe)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateFire(part)
local args = {
[1] = "CreateDecorations",
[2] = {
[1] = {
["Part"] = part,
["DecorationType"] = "Fire"
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshTexture(part,textureid)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["TextureId"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeColor(part,unioncoloringenabled,color)
local args = {
[1] = "SyncColor",
[2] = {
[1] = {
["Color"] = color,
["UnionColoring"] = unioncoloringenabled,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rename(part,name)
local args = {
[1] = "SetName",
[2] = {
[1] = part
},
[3] = name
}
Event:InvokeServer(unpack(args))
end
local function DestroyObject(part)
local args = {
[1] = "Remove",
[2] = {
[1] = part
}
}
Event:InvokeServer(unpack(args))
end
local function ResizeObject(part,cframe,vector3)
local args = {
[1] = "SyncResize",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe,
["Size"] = vector3
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeNeon(part)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Material"] = Enum.Material.Neon
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeDecal(part,face,textureid)
local args = {
[1] = "CreateTextures",
[2] = {
[1] = {
["Part"] = part,
["Face"] = face, -- Front, Top, Bottom, Front, Back, Left, Right
["TextureType"] = "Decal"
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncTexture",
[2] = {
[1] = {
["Part"] = part,
["Face"] = face, -- Front, Top, Bottom, Front, Back, Left, Right
["TextureType"] = "Decal",
["Texture"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
-- Function to find the nearest player
local function FindNearestPlayer(soldier)
local nearestPlayer = nil
local nearestDistance = math.huge
for _, player in pairs(game.Players:GetPlayers()) do
local character = player.Character
if character then
if character.HumanoidRootPart then
local distance = (character.HumanoidRootPart.Position - soldier.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPlayer = player
end
end
end
end
return nearestPlayer
end
local function GetNearestPart()
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("Right Arm")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (RightArm.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
return nearestPart
end
local function GetNearestPartTo(soldier)
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("Right Arm")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (soldier.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
return nearestPart
end
local function CreateShimmer(part)
CreateBall(part.CFrame, workspace);
local partd2 = GetNearestPart()
Rename(partd2, "Shimmer")
local bh = workspace:WaitForChild("Shimmer")
WeldTo(part,bh);
ResizeObject(bh, bh.CFrame, Vector3.new(10, 10, 10));
CanCollide(bh,false)
ChangeColor(bh,true,Color3.new(1, 1, 1))
ChangeNeon(bh)
local degreez = 0
local vectorx = 1;
local vectory = 1;
local vectorz = 1;
local incsize = 3;
local transparency = 0;
local impact = true;
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
task.wait(0.1)
ChangeTransparency(bh,transparency);
ResizeObject(bh, bh.CFrame, Vector3.new(incsize, incsize, incsize))
transparency = transparency + 0.01
vectory = vectory + 5
vectorx = vectorx + 20
vectorz = vectorz + 20
degreez = degreez + 100
incsize = incsize + 0.5
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (bh.Position - hrp.Position).Magnitude
if distance < 30 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,bh.CFrame);
impact = false
end
end
end
end
end
end
if transparency > 0.8 then
if workspace:FindFirstChild("Shimmer") then
DestroyObject(workspace:FindFirstChild("Shimmer"));
BreakWeld(char:FindFirstChild("HumanoidRootPart"),workspace:FindFirstChild("Shimmer"));
run:Disconnect()
end
end
end)
end
local function CreateSlamCard()
CreatePart(char.Head.CFrame + Vector3.new(0, 18, 0), workspace);
local partd = GetNearestPart()
Rename(partd, "Card")
local card = workspace:WaitForChild("Card")
ResizeObject(card, card.CFrame, Vector3.new(15.65, 23.84, 0.3))
ChangeNeon(card);
ChangeDecal(card,Enum.NormalId.Front,"rbxassetid://1880203893")
ChangeDecal(card,Enum.NormalId.Back,"rbxassetid://1880203893")
CanCollide(card,false)
CreateShimmer(card);
----create first slam effect----
CreatePart(card.CFrame, workspace);
local partd2 = GetNearestPart()
Rename(partd2, "Slam")
local slamm = workspace:WaitForChild("Slam")
CanCollide(slamm,false)
CreateMesh(slamm,"rbxassetid://20329976");
ChangeColor(slamm,true,Color3.new(0.631373, 0.631373, 0.631373))
ChangeTransparency(slamm,1);
----create second---------------
CreatePart(card.CFrame, workspace);
local partd3 = GetNearestPart()
Rename(partd3, "Slam2")
local slamm2 = workspace:WaitForChild("Slam2")
CanCollide(slamm2,false)
CreateMesh(slamm2,"rbxassetid://20329976");
ChangeColor(slamm2,true,Color3.new(0.631373, 0.631373, 0.631373))
ChangeTransparency(slamm2,1);
local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local savedLookVector = nil
local slamming = false
local function updateCardRotation()
if not slamming then
local headCFrame = char.Head.CFrame
local lookVector = headCFrame.LookVector
local rightVector = headCFrame.RightVector
local forwardVector = Vector3.new(lookVector.X, 0, lookVector.Z).Unit
local anglesX, anglesY, anglesZ = 0, math.atan2(forwardVector.X, forwardVector.Z), 0
Rotate(card, headCFrame.Position.X, headCFrame.Position.Y + 18, headCFrame.Position.Z, anglesX, anglesY, anglesZ)
end
end
userInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 and not slamming then
local headCFrame = char.Head.CFrame
local lookVector = headCFrame.LookVector
local rightVector = headCFrame.RightVector
local forwardVector = Vector3.new(lookVector.X, 0, lookVector.Z).Unit
savedLookVector = forwardVector
slamming = true
local slamPosition = headCFrame.Position + forwardVector * 10
local anglesX, anglesY, anglesZ = math.pi / 2, 0, math.atan2(forwardVector.X, forwardVector.Z)
Rotate(card, slamPosition.X, slamPosition.Y - 4.5, slamPosition.Z, anglesX, anglesY, anglesZ)
task.wait(0.01)
local slam = workspace:WaitForChild("Slam")
local slam2 = workspace:WaitForChild("Slam2")
MovePart(slam,card.CFrame);
MovePart(slam2,card.CFrame);
ChangeTransparency(slam,0);
ChangeTransparency(slam2,0);
local degreez = 0
local vectorx = 1;
local vectory = 1;
local vectorz = 1;
local vectorx2 = 1;
local vectory2 = 1;
local vectorz2 = 1;
local transparency = 0;
local impact = true;
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
task.wait(0.01)
Rotate(slam,slam.CFrame.X,slam.CFrame.Y,slam.CFrame.Z,0,math.rad(degreez),0)
Rotate(slam2,slam2.CFrame.X,slam2.CFrame.Y,slam2.CFrame.Z,0,math.rad(degreez),0)
ChangeMeshSize(slam,Vector3.new(vectorx, vectory, vectorz));
ChangeMeshSize(slam2,Vector3.new(vectorx2, vectory2, vectorz2));
ChangeTransparency(slam,transparency);
ChangeTransparency(slam2,transparency);
transparency = transparency + 0.01
vectory = vectory + 1
vectorx = vectorx + 1
vectorz = vectorz + 1
vectory2 = vectory2 + 0.5
vectorx2 = vectorx2 + 0.5
vectorz2 = vectorz2 + 0.5
degreez = degreez + 5
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (slam.Position - hrp.Position).Magnitude
if distance < 40 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,CFrame.new(math.random(-100,100),math.random(10,100),math.random(-100,100)))
impact = false
end
end
end
end
end
end
if transparency > 0.8 then
if workspace:FindFirstChild("Slam") and workspace:FindFirstChild("Slam2") then
run:Disconnect()
DestroyObject(workspace:FindFirstChild("Slam"));
DestroyObject(workspace:FindFirstChild("Slam2"))
DestroyObject(card);
end
end
end)
end
end)
runService.RenderStepped:Connect(updateCardRotation)
end
local function CreateBlackholeCard()
local stop = false;
CreatePart(char.Head.CFrame + Vector3.new(0, 18, 0), workspace);
local partd = GetNearestPart()
Rename(partd, "Card")
local card = workspace:WaitForChild("Card")
ResizeObject(card, card.CFrame, Vector3.new(15.65, 23.84, 0.3))
ChangeNeon(card);
ChangeDecal(card,Enum.NormalId.Front,"rbxassetid://1880203893")
ChangeDecal(card,Enum.NormalId.Back,"rbxassetid://1880203893")
CanCollide(card,false)
local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local savedLookVector = nil
local slamming = false
userInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 and not slamming then
local headCFrame = char.Head.CFrame
local lookVector = headCFrame.LookVector
local rightVector = headCFrame.RightVector
local forwardVector = Vector3.new(lookVector.X, 0, lookVector.Z).Unit
savedLookVector = forwardVector
slamming = true
local slamPosition = headCFrame.Position + forwardVector * 10
local anglesX, anglesY, anglesZ = math.pi / 2, 0, math.atan2(forwardVector.X, forwardVector.Z)
wait(0.5)
CreateBall(card.CFrame, workspace);
local partd2 = GetNearestPart()
Rename(partd2, "Blackhole")
local bh = workspace:WaitForChild("Blackhole")
CanCollide(bh,false)
ChangeColor(bh,true,Color3.new(0, 0, 0))
ChangeNeon(bh)
CreateShimmer(workspace:FindFirstChild("Blackhole"));
CreatePart(workspace:FindFirstChild("Blackhole").CFrame, workspace);
local partdd2 = GetNearestPart()
Rename(partdd2, "Slam")
local slem = workspace:WaitForChild("Slam")
CreateMesh(slem,"rbxassetid://20329976");
ChangeTransparency(slem,1)
local degreez = 0
local vectorx = 1;
local vectory = 1;
local vectorz = 1;
local incsize = 3;
local transparency = 0;
local impact = true;
local mouse = LocalPlayer:GetMouse()
local truepos = mouse.hit.p.X
local truepos2 = mouse.hit.p.Z
MovePart(card, CFrame.new(truepos,card.CFrame.Y,truepos2))
MovePart(bh, card.CFrame)
WeldTo(bh,card)
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
if stop == true then
run:Disconnect()
return
else
task.wait(0.3)
Rotate(card,card.CFrame.X,card.CFrame.Y,card.CFrame.Z,0,math.rad(degreez),0)
ChangeMeshSize(card,Vector3.new(vectorx, vectory, vectorz));
ChangeTransparency(bh,transparency);
ResizeObject(bh, bh.CFrame, Vector3.new(incsize, incsize, incsize))
transparency = transparency + 0.01
vectory = vectory + 5
vectorx = vectorx + 20
vectorz = vectorz + 20
degreez = degreez + 100
incsize = incsize + 0.1
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (card.Position - hrp.Position).Magnitude
if distance < 100 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(hrp,bh.CFrame);
MovePart(head,bh.CFrame);
impact = false
end
end
end
end
end
end
if transparency > 0.8 then
if workspace:FindFirstChild("Blackhole") then
run:Disconnect()
local slam = workspace:FindFirstChild("Slam")
MovePart(slam,workspace:FindFirstChild("Blackhole").CFrame);
DestroyObject(workspace:FindFirstChild("Blackhole"));
DestroyObject(card);
ChangeTransparency(slam,1)
CanCollide(slam,false)
--CreateMesh(slam,"rbxassetid://20329976");
ChangeColor(slam,true,Color3.new(0, 0, 0))
local degreezz = 0
local vectorxx = 10;
local vectoryy = 2;
local vectorzz = 10;
local incsize = 3;
local transparencyy = 0;
local run2
run2 = game:GetService("RunService").Heartbeat:Connect(function()
if stop == true then
run2:Disconnect()
return
else
task.wait(0.01)
impact = true
Rotate(slam,slam.CFrame.X,slam.CFrame.Y,slam.CFrame.Z,0,math.rad(degreezz),0)
ChangeMeshSize(slam,Vector3.new(vectorxx, vectoryy, vectorzz));
ChangeTransparency(slam,transparencyy);
transparencyy = transparencyy + 0.1
vectoryy = vectoryy + 1
vectorxx = vectorxx + 10
vectorzz = vectorzz + 10
degreezz = degreezz + 5
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (slam.Position - hrp.Position).Magnitude
if distance < 200 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,CFrame.new(math.random(-100,100),math.random(10,100),math.random(-100,100)))
impact = false
end
end
end
end
end
end
if transparencyy > 0.5 then
if workspace:FindFirstChild("Slam") then
stop = true;
run2:Disconnect()
run:Disconnect()
DestroyObject(slam);
return
end
end
end
end)
end
end
end
end)
end
end)
end
local function CreateCardStorm()
char.HumanoidRootPart.Anchored = true;
CreateShimmer(char.Head)
CreatePart(char.Head.CFrame, workspace);
local partd = GetNearestPart()
Rename(partd, "Storm")
local card = workspace:WaitForChild("Storm")
CreateMesh(card,"rbxassetid://6512150")
ChangeMeshTexture(card,"rbxassetid://55364685")
ChangeMeshSize(card,Vector3.new(5,5,5))
CanCollide(card,false)
----create first slam effect----
CreatePart(card.CFrame, workspace);
local partd2 = GetNearestPart()
Rename(partd2, "Slam")
local slamm = workspace:WaitForChild("Slam")
CanCollide(slamm,false)
CreateMesh(slamm,"rbxassetid://20329976");
ChangeColor(slamm,true,Color3.new(0.631373, 0.631373, 0.631373))
----create second---------------
CreatePart(card.CFrame, workspace);
local partd3 = GetNearestPart()
Rename(partd3, "Slam2")
local slamm2 = workspace:WaitForChild("Slam2")
CanCollide(slamm2,false)
CreateMesh(slamm2,"rbxassetid://20329976");
ChangeColor(slamm2,true,Color3.new(0.631373, 0.631373, 0.631373))
local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local savedLookVector = nil
local slamming = false
local function updateCardRotation()
if not slamming then
local headCFrame = char.Head.CFrame
local lookVector = headCFrame.LookVector
local rightVector = headCFrame.RightVector
local forwardVector = Vector3.new(lookVector.X, 0, lookVector.Z).Unit
local anglesX, anglesY, anglesZ = 0, math.atan2(forwardVector.X, forwardVector.Z), 0
Rotate(card, headCFrame.Position.X, headCFrame.Position.Y + 18, headCFrame.Position.Z, anglesX, anglesY, anglesZ)
end
end
local headCFrame = char.Head.CFrame
local lookVector = headCFrame.LookVector
local rightVector = headCFrame.RightVector
local forwardVector = Vector3.new(lookVector.X, 0, lookVector.Z).Unit
savedLookVector = forwardVector
slamming = true
local slamPosition = headCFrame.Position + forwardVector * 10
local anglesX, anglesY, anglesZ = math.pi / 2, 0, math.atan2(forwardVector.X, forwardVector.Z)
--Rotate(card, slamPosition.X, slamPosition.Y - 4.5, slamPosition.Z, anglesX, anglesY, anglesZ)
task.wait(0.01)
local slam = workspace:WaitForChild("Slam")
local slam2 = workspace:WaitForChild("Slam2")
MovePart(slam,card.CFrame);
MovePart(slam2,card.CFrame);
ChangeTransparency(slam,0);
ChangeTransparency(slam2,0);
local degreez = 0
local vectorx = 30;
local vectory = 10;
local vectorz = 30;
local vectorx2 = 50;
local vectory2 = 10;
local vectorz2 = 50;
local rotationvector = 0;
local transparency = 0;
local impact = true;
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
task.wait(0.1)
Rotate(card,card.CFrame.X,card.CFrame.Y,card.CFrame.Z,0,math.rad(rotationvector),0)
Rotate(slam,slam.CFrame.X,slam.CFrame.Y,slam.CFrame.Z,0,math.rad(degreez),0)
Rotate(slam2,slam2.CFrame.X,slam2.CFrame.Y,slam2.CFrame.Z,0,math.rad(degreez),0)
ChangeMeshSize(slam,Vector3.new(vectorx, vectory, vectorz));
ChangeMeshSize(slam2,Vector3.new(vectorx2, vectory2, vectorz2));
ChangeTransparency(slam,transparency);
ChangeTransparency(slam2,transparency);
transparency = transparency + 0.005
degreez = degreez + 5
if vectorx < 100 then
vectory = vectory + 0.1
vectorx = vectorx + 10
vectorz = vectorz + 10
vectory2 = vectory2 + 0.5
vectorx2 = vectorx2 + 5
vectorz2 = vectorz2 + 5
else
vectory = vectory - 0.1
vectorx = vectorx - 5
vectorz = vectorz - 5
vectory2 = vectory2 - 0.1
vectorx2 = vectorx2 - 10
vectorz2 = vectorz2 - 10
end
rotationvector = rotationvector + 100
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (slam.Position - hrp.Position).Magnitude
if distance < 100 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,CFrame.new(math.random(-100,100),math.random(10,100),math.random(-100,100)))
impact = false
end
end
end
end
end
end
if transparency > 1 then
if workspace:FindFirstChild("Slam") and workspace:FindFirstChild("Slam2") then
DestroyObject(workspace:FindFirstChild("Slam"));
DestroyObject(workspace:FindFirstChild("Slam2"))
DestroyObject(card);
char.HumanoidRootPart.Anchored = false;
run:Disconnect()
end
end
end)
end
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.C then
if (not gameprocess) then
CreateSlamCard()
end
end
end)
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.V then
if (not gameprocess) then
CreateBlackholeCard()
end
end
end)
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.B then
if (not gameprocess) then
CreateCardStorm()
end
end
end)
end
local function dodynr6()
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local char = LocalPlayer.Character
local Event = LocalPlayer.Backpack:FindFirstChild("Building Tools").SyncAPI.ServerEndpoint
local UIS = game:GetService("UserInputService")
local function CreatePart(position,parent)
Event:InvokeServer("CreatePart", "Normal", position, parent)
end
--workspace.Part
local function CreateMesh(part,meshid)
local args = {
[1] = "CreateMeshes",
[2] = {
[1] = {
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["MeshType"] = Enum.MeshType.FileMesh,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["MeshId"] = meshid
}
}
}
Event:InvokeServer(unpack(args))
end
local function CanCollide(part,cancollide)
local args = {
[1] = "SyncCollision",
[2] = {
[1] = {
["Part"] = part,
["CanCollide"] = cancollide
}
}
}
Event:InvokeServer(unpack(args))
end
local function Anchor(part,anchor)
local args = {
[1] = "SyncAnchor",
[2] = {
[1] = {
["Part"] = part,
["Anchored"] = anchor
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rotate(part,degreex,degreey,degreez,anglesx,anglesy,anglesz)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = CFrame.new(degreex, degreey, degreez) * CFrame.Angles(anglesx, anglesy,anglesz)
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshSize(part,vector3size)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["Scale"] = vector3size
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeTransparency(part,transparency)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Transparency"] = transparency
}
}
}
Event:InvokeServer(unpack(args))
end
local function WeldTo(parttoweld,parttoweldto)
local args = {
[1] = "CreateWelds",
[2] = {
[1] = parttoweld
},
[3] = parttoweldto
}
Event:InvokeServer(unpack(args))
end
local function BreakWeld(weldtobreak)
local args = {
[1] = "RemoveWelds",
[2] = {weldtobreak}
}
Event:InvokeServer(unpack(args))
end
local function MovePart(part,cframe)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateFire(part)
local args = {
[1] = "CreateDecorations",
[2] = {
[1] = {
["Part"] = part,
["DecorationType"] = "Fire"
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshTexture(part,textureid)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["TextureId"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeColor(part,unioncoloringenabled,color)
local args = {
[1] = "SyncColor",
[2] = {
[1] = {
["Color"] = color,
["UnionColoring"] = unioncoloringenabled,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rename(part,name)
local args = {
[1] = "SetName",
[2] = {
[1] = part
},
[3] = name
}
Event:InvokeServer(unpack(args))
end
local function DestroyObject(part)
local args = {
[1] = "Remove",
[2] = {
[1] = part
}
}
Event:InvokeServer(unpack(args))
end
local function GetNearestPart()
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("Right Arm")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (RightArm.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
return nearestPart
end
local function createhammer(player)
CreatePart(player.Character:FindFirstChild("Right Arm").CFrame,workspace);
local partd = GetNearestPart();
Rename(partd,"Gigachad")
local part = workspace:WaitForChild("Gigachad")
Rotate(part,part.CFrame.X,part.CFrame.Y,part.CFrame.Z,0,0,math.rad(90))
WeldTo(part,player.Character:FindFirstChild("Right Arm"));
CreateMesh(part,"rbxassetid://10172112489");
ChangeMeshTexture(part,"rbxassetid://10172112542");
ChangeMeshSize(part,Vector3.new(0.1,0.1,0.1));
CanCollide(part,false);
Anchor(part,false);
CreatePart(part.CFrame,workspace);
local partd2 = GetNearestPart();
Rename(partd2,"Gigaboom");
local part2 = workspace:WaitForChild("Gigaboom")
ChangeTransparency(part2,1);
CreateMesh(part2,"rbxassetid://6862105399");
CanCollide(part2,false);
local touched = false;
local dropstate = false;
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.C then
if dropstate == true then
--do nothin
else
if player.Character:FindFirstChild("Right Arm").BTWeld then
BreakWeld(player.Character:FindFirstChild("Right Arm").BTWeld);
else
BreakWeld(part.BTWeld);
end
MovePart(part,CFrame.new(part.CFrame.X,part.CFrame.Y,part.CFrame.Z+2))
CanCollide(part,true);
CreateFire(part);
dropstate = true;
end
end
end)
part.Touched:Connect(function(toucher)
if dropstate == true then
if not touched then
local stop = false;
touched = true
task.wait(2) --detonation secs
MovePart(part2,part.CFrame)
ChangeTransparency(part,1);
DestroyObject(part);
local degreez = 0
local vectorx = 1;
local vectory = 1;
local vectorz = 1;
local localsound = Instance.new("Sound",workspace);
localsound.SoundId = "rbxassetid://2814355743"
localsound.Volume = 10
localsound:Play();
local transparency = 0;
local impact = true;
ChangeTransparency(part2,0)
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
if stop == true then
run:Disconnect();
else
Rotate(part2,part2.CFrame.X,part2.CFrame.Y,part2.CFrame.Z,0,math.rad(degreez),0)
ChangeMeshSize(part2,Vector3.new(vectorx, vectory, vectorz));
ChangeTransparency(part2,transparency);
transparency = transparency + 0.03
vectory = vectory + 10
vectorx = vectorx + 0.5
vectorz = vectorz + 0.5
degreez = degreez + 10
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (part2.Position - hrp.Position).Magnitude
if distance < 30 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,CFrame.new(math.random(-100,100),math.random(10,100),math.random(-100,100)))
impact = false
end
end
end
end
end
end
if transparency > 1 then
if workspace:FindFirstChild("Gigaboom") then
DestroyObject(workspace:FindFirstChild("Gigaboom"));
run:Disconnect();
stop = true;
end
end
end
end)
end
end
end)
end
createhammer(game.Players.LocalPlayer)
end
local function dovisr6()
-------todo: cool effects
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local char = LocalPlayer.Character
local Event = LocalPlayer.Backpack:FindFirstChild("Building Tools").SyncAPI.ServerEndpoint
local UIS = game:GetService("UserInputService")
local function CreatePart(position,parent)
Event:InvokeServer("CreatePart", "Normal", position, parent)
end
local function CreateBall(position,parent)
Event:InvokeServer("CreatePart", "Ball", position, parent)
end
local function CreateCylinder(position,parent)
Event:InvokeServer("CreatePart", "Cylinder", position, parent)
end
--workspace.Part
local function CreateMesh(part,meshid)
local args = {
[1] = "CreateMeshes",
[2] = {
[1] = {
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["MeshType"] = Enum.MeshType.FileMesh,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["MeshId"] = meshid
}
}
}
Event:InvokeServer(unpack(args))
end
local function CanCollide(part,cancollide)
local args = {
[1] = "SyncCollision",
[2] = {
[1] = {
["Part"] = part,
["CanCollide"] = cancollide
}
}
}
Event:InvokeServer(unpack(args))
end
local function Anchor(part,anchor)
local args = {
[1] = "SyncAnchor",
[2] = {
[1] = {
["Part"] = part,
["Anchored"] = anchor
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rotate(part,degreex,degreey,degreez,anglesx,anglesy,anglesz)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = CFrame.new(degreex, degreey, degreez) * CFrame.Angles(anglesx, anglesy,anglesz)
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshSize(part,vector3size)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["Scale"] = vector3size
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeTransparency(part,transparency)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Transparency"] = transparency
}
}
}
Event:InvokeServer(unpack(args))
end
local function WeldTo(parttoweld,parttoweldto)
local args = {
[1] = "CreateWelds",
[2] = {
[1] = parttoweld
},
[3] = parttoweldto
}
Event:InvokeServer(unpack(args))
end
local function BreakWeld(weldtobreak)
local args = {
[1] = "RemoveWelds",
[2] = {weldtobreak}
}
Event:InvokeServer(unpack(args))
end
local function MovePart(part,cframe)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateFire(part)
local args = {
[1] = "CreateDecorations",
[2] = {
[1] = {
["Part"] = part,
["DecorationType"] = "Fire"
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshTexture(part,textureid)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["TextureId"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeColor(part,unioncoloringenabled,color)
local args = {
[1] = "SyncColor",
[2] = {
[1] = {
["Color"] = color,
["UnionColoring"] = unioncoloringenabled,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rename(part,name)
local args = {
[1] = "SetName",
[2] = {
[1] = part
},
[3] = name
}
Event:InvokeServer(unpack(args))
end
local function DestroyObject(part)
local args = {
[1] = "Remove",
[2] = {
[1] = part
}
}
Event:InvokeServer(unpack(args))
end
local function ResizeObject(part,cframe,vector3)
local args = {
[1] = "SyncResize",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe,
["Size"] = vector3
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeNeon(part)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Material"] = Enum.Material.Neon
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeDecal(part,face,textureid)
local args = {
[1] = "CreateTextures",
[2] = {
[1] = {
["Part"] = part,
["Face"] = face, -- Front, Top, Bottom, Front, Back, Left, Right
["TextureType"] = "Decal"
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncTexture",
[2] = {
[1] = {
["Part"] = part,
["Face"] = face, -- Front, Top, Bottom, Front, Back, Left, Right
["TextureType"] = "Decal",
["Texture"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
-- Function to find the nearest player
local function FindNearestPlayer(soldier)
local nearestPlayer = nil
local nearestDistance = math.huge
for _, player in pairs(game.Players:GetPlayers()) do
local character = player.Character
if character then
if character.HumanoidRootPart then
local distance = (character.HumanoidRootPart.Position - soldier.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPlayer = player
end
end
end
end
return nearestPlayer
end
local function GetNearestPart()
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("Right Arm")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (RightArm.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
return nearestPart
end
local function GetNearestPartTo(soldier)
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("Right Arm")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (soldier.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
return nearestPart
end
local function CreateVisualizer()
---------------------VISUALIZER------------------------------------------
CreatePart(char:FindFirstChild("HumanoidRootPart").CFrame, workspace);
local partd = workspace:WaitForChild("Part")
Rename(partd, "Visualizer");
local part = workspace:FindFirstChild("Visualizer")
CanCollide(part, false);
Anchor(part, true);
ResizeObject(part, part.CFrame, Vector3.new(5, 0.5, 5))
ChangeColor(part,true,Color3.new(0.694118, 0, 0))
ChangeNeon(part);
local hrp = char:FindFirstChild("HumanoidRootPart")
local rightarm = char:FindFirstChild("RightHand")
local degreez = 0
local vectorx = 1;
local vectory = 1;
local vectorz = 1;
local incsize = 1;
local incrementing = true;
local sound = Instance.new("Sound", workspace)
sound.SoundId = "rbxassetid://15689447272"
sound.Volume = 10; -- Set volume to 0 to analyze the audio without playing it
sound:Play()
local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
local head = char:FindFirstChild("Head")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local savedLookVector = nil
local stop = false
local audioTime = 0
local beatThreshold = 0.5
local beatDuration = 0.1
local lastBeatTime = 0
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
if stop == true then
run:Disconnect()
else
task.wait(0.1)
Rotate(part, humanoidRootPart.CFrame.X, humanoidRootPart.CFrame.Y-3, humanoidRootPart.CFrame.Z, 0, math.rad(degreez), 0)
audioTime = sound.TimePosition
local beatAmplitude = (math.sin(audioTime * 2) + 1) / 2
if beatAmplitude > beatThreshold then
local incsize = beatAmplitude * 10 + 1
ResizeObject(part, part.CFrame, Vector3.new(incsize, 0.5, incsize))
lastBeatTime = audioTime
else
ResizeObject(part, part.CFrame, Vector3.new(1, 0.5, 1))
end
degreez = degreez + 10
end
end)
end
CreateVisualizer()
end
local function dosoldierr6()
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local char = LocalPlayer.Character
local Event = LocalPlayer.Backpack:FindFirstChild("Building Tools").SyncAPI.ServerEndpoint
local UIS = game:GetService("UserInputService")
local function CreatePart(position,parent)
Event:InvokeServer("CreatePart", "Normal", position, parent)
end
--workspace.Part
local function CreateMesh(part,meshid)
local args = {
[1] = "CreateMeshes",
[2] = {
[1] = {
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["MeshType"] = Enum.MeshType.FileMesh,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["MeshId"] = meshid
}
}
}
Event:InvokeServer(unpack(args))
end
local function CanCollide(part,cancollide)
local args = {
[1] = "SyncCollision",
[2] = {
[1] = {
["Part"] = part,
["CanCollide"] = cancollide
}
}
}
Event:InvokeServer(unpack(args))
end
local function Anchor(part,anchor)
local args = {
[1] = "SyncAnchor",
[2] = {
[1] = {
["Part"] = part,
["Anchored"] = anchor
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rotate(part,degreex,degreey,degreez,anglesx,anglesy,anglesz)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = CFrame.new(degreex, degreey, degreez) * CFrame.Angles(anglesx, anglesy,anglesz)
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshSize(part,vector3size)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["Scale"] = vector3size
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeTransparency(part,transparency)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Transparency"] = transparency
}
}
}
Event:InvokeServer(unpack(args))
end
local function WeldTo(parttoweld,parttoweldto)
local args = {
[1] = "CreateWelds",
[2] = {
[1] = parttoweld
},
[3] = parttoweldto
}
Event:InvokeServer(unpack(args))
end
local function BreakWeld(weldtobreak)
local args = {
[1] = "RemoveWelds",
[2] = {weldtobreak}
}
Event:InvokeServer(unpack(args))
end
local function MovePart(part,cframe)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateFire(part)
local args = {
[1] = "CreateDecorations",
[2] = {
[1] = {
["Part"] = part,
["DecorationType"] = "Fire"
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshTexture(part,textureid)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["TextureId"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeColor(part,unioncoloringenabled,color)
local args = {
[1] = "SyncColor",
[2] = {
[1] = {
["Color"] = color,
["UnionColoring"] = unioncoloringenabled,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rename(part,name)
local args = {
[1] = "SetName",
[2] = {
[1] = part
},
[3] = name
}
Event:InvokeServer(unpack(args))
end
local function DestroyObject(part)
local args = {
[1] = "Remove",
[2] = {
[1] = part
}
}
Event:InvokeServer(unpack(args))
end
local function ResizeObject(part,cframe,vector3)
local args = {
[1] = "SyncResize",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe,
["Size"] = vector3
}
}
}
Event:InvokeServer(unpack(args))
end
-- Function to find the nearest player
local function FindNearestPlayer(soldier)
local nearestPlayer = nil
local nearestDistance = math.huge
for _, player in pairs(game.Players:GetPlayers()) do
local character = player.Character
if character then
if character.HumanoidRootPart then
local distance = (character.HumanoidRootPart.Position - soldier.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPlayer = player
end
end
end
end
return nearestPlayer
end
local function GetNearestPart()
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("Right Arm")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (RightArm.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
return nearestPart
end
local function GetNearestPartTo(soldier)
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("Right Arm")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (soldier.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
return nearestPart
end
--local newpos = game.Players.LocalPlayer.Character:FindFirstChild("RightHand").CFrame.Z + 10
--CreatePart(CFrame.new(game.Players.LocalPlayer.Character:FindFirstChild("RightHand").CFrame.X,game.Players.LocalPlayer.Character:FindFirstChild("RightHand").CFrame.Y,newpos),workspace)
local function CreateSoldier()
local newpos = game.Players.LocalPlayer.Character:FindFirstChild("Right Arm").CFrame.Z + 10
CreatePart(CFrame.new(game.Players.LocalPlayer.Character:FindFirstChild("Right Arm").CFrame.X,game.Players.LocalPlayer.Character:FindFirstChild("Right Arm").CFrame.Y,newpos),workspace)
local partd = GetNearestPart()
ResizeObject(partd,partd.CFrame,Vector3.new(12, 1, 2))
Rename(partd,"Gigachad")
local soldier = workspace:WaitForChild("Gigachad")
CreateMesh(soldier,"rbxassetid://16751697688");
ChangeMeshTexture(soldier,"rbxassetid://16751697852");
Anchor(soldier,true);
CanCollide(soldier,false)
local bull = false;
local bullet = nil;
while true do
local nearestPlayer = FindNearestPlayer(soldier)
if nearestPlayer then
if nearestPlayer.Name == game.Players.LocalPlayer.Name then
else
local character = nearestPlayer.Character
if character then
local targetPosition = character.HumanoidRootPart.Position
local direction = (targetPosition - soldier.Position).Unit
local rotation = math.atan2(direction.X, direction.Z)
Rotate(soldier, soldier.Position.X, soldier.Position.Y, soldier.Position.Z, 0, rotation, 0)
--SHOOTING
if bull == false and bullet == nil then
bull = true
CreatePart(soldier.CFrame,workspace)
local partl = GetNearestPartTo(soldier)
Rename(partl,"Bullet")
bullet = workspace:WaitForChild("Bullet")
CreateFire(bullet);
ChangeTransparency(bullet,1);
CanCollide(bullet,false)
local ls = Instance.new("Sound",workspace)
ls.Volume = 100;
ls.SoundId = "rbxassetid://1646327903"
ls:Play()
local speed = 5
local target = character.HumanoidRootPart.Position
local maxDistance = 100 -- max distance the bullet can travel
local function ShootBullet()
while bullet and (bullet.Position - target).Magnitude > 1 and (bullet.Position - soldier.Position).Magnitude < maxDistance do
local direction = (target - bullet.Position).Unit
local newPosition = bullet.Position + direction * speed * 0.7
MovePart(bullet, CFrame.new(newPosition))
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("Head")
if head and hrp then
local distance = (bullet.Position - hrp.Position).Magnitude
if distance < 15 then
DestroyObject(bullet)
DestroyObject(head)
bull = false
bullet = nil
ls:Destroy()
break
end
end
end
end
task.wait(0.1)
end
if bull then
if bullet then
DestroyObject(bullet)
end
bull = false
bullet = nil
end
end
ShootBullet()
end
end
end
end
wait(0.1)
end
end
CreateSoldier()
end
local function dofreemanr6()
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local char = LocalPlayer.Character
local Event = LocalPlayer.Backpack:FindFirstChild("Building Tools").SyncAPI.ServerEndpoint
local UIS = game:GetService("UserInputService")
local function CreatePart(position,parent)
Event:InvokeServer("CreatePart", "Normal", position, parent)
end
local function CreateBall(position,parent)
Event:InvokeServer("CreatePart", "Ball", position, parent)
end
local function CreateCylinder(position,parent)
Event:InvokeServer("CreatePart", "Cylinder", position, parent)
end
--workspace.Part
local function CreateMesh(part,meshid)
local args = {
[1] = "CreateMeshes",
[2] = {
[1] = {
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["MeshType"] = Enum.MeshType.FileMesh,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["MeshId"] = meshid
}
}
}
Event:InvokeServer(unpack(args))
end
local function CanCollide(part,cancollide)
local args = {
[1] = "SyncCollision",
[2] = {
[1] = {
["Part"] = part,
["CanCollide"] = cancollide
}
}
}
Event:InvokeServer(unpack(args))
end
local function Anchor(part,anchor)
local args = {
[1] = "SyncAnchor",
[2] = {
[1] = {
["Part"] = part,
["Anchored"] = anchor
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rotate(part,degreex,degreey,degreez,anglesx,anglesy,anglesz)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = CFrame.new(degreex, degreey, degreez) * CFrame.Angles(anglesx, anglesy,anglesz)
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshSize(part,vector3size)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["Scale"] = vector3size
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeTransparency(part,transparency)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Transparency"] = transparency
}
}
}
Event:InvokeServer(unpack(args))
end
local function WeldTo(parttoweld,parttoweldto)
local args = {
[1] = "CreateWelds",
[2] = {
[1] = parttoweld
},
[3] = parttoweldto
}
Event:InvokeServer(unpack(args))
end
local function BreakWeld(weldtobreak)
local args = {
[1] = "RemoveWelds",
[2] = {weldtobreak}
}
Event:InvokeServer(unpack(args))
end
local function MovePart(part,cframe)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateFire(part)
local args = {
[1] = "CreateDecorations",
[2] = {
[1] = {
["Part"] = part,
["DecorationType"] = "Fire"
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshTexture(part,textureid)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["TextureId"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeColor(part,unioncoloringenabled,color)
local args = {
[1] = "SyncColor",
[2] = {
[1] = {
["Color"] = color,
["UnionColoring"] = unioncoloringenabled,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rename(part,name)
local args = {
[1] = "SetName",
[2] = {
[1] = part
},
[3] = name
}
Event:InvokeServer(unpack(args))
end
local function DestroyObject(part)
local args = {
[1] = "Remove",
[2] = {
[1] = part
}
}
Event:InvokeServer(unpack(args))
end
local function ResizeObject(part,cframe,vector3)
local args = {
[1] = "SyncResize",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe,
["Size"] = vector3
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeNeon(part)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Material"] = Enum.Material.Neon
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeDecal(part,face,textureid)
local args = {
[1] = "CreateTextures",
[2] = {
[1] = {
["Part"] = part,
["Face"] = face, -- Front, Top, Bottom, Front, Back, Left, Right
["TextureType"] = "Decal"
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncTexture",
[2] = {
[1] = {
["Part"] = part,
["Face"] = face, -- Front, Top, Bottom, Front, Back, Left, Right
["TextureType"] = "Decal",
["Texture"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateSmoke(part)
local args = {
[1] = "CreateDecorations",
[2] = {
[1] = {
["Part"] = part,
["DecorationType"] = "Smoke"
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateSpotLight(part)
local args = {
[1] = "CreateLights",
[2] = {
[1] = {
["Part"] = part,
["LightType"] = "SpotLight" -- Spot light, Point light, Surface light
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeBrightness(part)
local args = {
[1] = "SyncLighting",
[2] = {
[1] = {
["Part"] = part,
["LightType"] = "SpotLight", -- or "SpotLight"
["Brightness"] = 10
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeBrightnessAngle(part,angle)
local args = {
[1] = "SyncLighting",
[2] = {
[1] = {
["Part"] = part,
["LightType"] = "SpotLight", -- or "SpotLight"
["Angle"] = angle
}
}
}
Event:InvokeServer(unpack(args))
end
-- Function to find the nearest player
local function FindNearestPlayer(soldier)
local nearestPlayer = nil
local nearestDistance = math.huge
for _, player in pairs(game.Players:GetPlayers()) do
local character = player.Character
if character then
if character.HumanoidRootPart then
local distance = (character.HumanoidRootPart.Position - soldier.Position).Magnitude
if distance < nearestDistance then
if player.Name == game.Players.LocalPlayer.Name then
else
nearestDistance = distance
nearestPlayer = player
end
end
end
end
end
return nearestPlayer
end
local function GetNearestPart()
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("HumanoidRootPart")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (RightArm.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
return nearestPart
end
local function GetNearestPartTo(soldier)
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("HumanoidRootPart")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") or part:IsA("MeshPart") then
if part.Name == "crowbar" or part.Name == "Hull" or part.Name == "gun" or part.Name == "rpg" or part.Parent == game.Players.LocalPlayer.Character then
else
local distance = (soldier.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
end
return nearestPart
end
---------freeman script---------------------
if char:FindFirstChild("Animate") then
char:FindFirstChild("Animate"):Destroy()
end
for i,v in char:GetChildren() do
if v:IsA("Accessory") then
v:Destroy()
elseif v:IsA("Part") or v:IsA("MeshPart") then
ChangeTransparency(v,1);
end
end
if char:FindFirstChild("Head"):FindFirstChild("face") then
DestroyObject(char:FindFirstChild("Head"):FindFirstChild("face"));
end
---ye-----------------------------------
CreatePart(char:FindFirstChild("Torso").CFrame,workspace.Terrain)
local akakak = GetNearestPart()
CanCollide(akakak,false)
Rename(akakak,"Hull")
local hull = workspace.Terrain:FindFirstChild("Hull")
CreateMesh(hull,"rbxassetid://12903182903")
ChangeMeshTexture(hull,"rbxassetid://1202034198")
ChangeMeshSize(hull,Vector3.new(0.2,0.2,0.2))
local createcouch = Instance.new("Tool",char)
createcouch.Enabled = true
createcouch.RequiresHandle = false
createcouch.Name = "CreateCouch"
local createsmoke = Instance.new("Tool",char)
createsmoke.Enabled = true
createsmoke.RequiresHandle = false
createsmoke.Name = "CreateSmoke"
local createc4 = Instance.new("Tool",char)
createc4.Enabled = true
createc4.RequiresHandle = false
createc4.Name = "CreateC4"
local grab = Instance.new("Tool",char)
grab.Enabled = true
grab.RequiresHandle = false
grab.Name = "Grab"
local function CreateCouch()
local tors = char:FindFirstChild("Torso")
CreatePart(CFrame.new(tors.CFrame.X,tors.CFrame.Y+10,tors.CFrame.Z+4),workspace.Terrain)
local akakakek = GetNearestPart()
local randomname = math.random(1,1000);
Rename(akakakek,tostring(randomname))
local newcouch = workspace.Terrain:FindFirstChild(tostring(randomname))
CreateMesh(newcouch,"rbxassetid://437989588")
ChangeMeshTexture(newcouch,"rbxassetid://437989607")
ChangeMeshSize(newcouch,Vector3.new(0.001,0.001,0.001))
Anchor(newcouch,false)
end
local function CSmoke()
local tors = char:FindFirstChild("Torso")
CreatePart(CFrame.new(tors.CFrame.X,tors.CFrame.Y+10,tors.CFrame.Z+4),workspace.Terrain)
local akakakek = GetNearestPart()
local randomname = math.random(1,1000);
Rename(akakakek,tostring(randomname))
local newsmoke = workspace.Terrain:FindFirstChild(tostring(randomname))
CreateMesh(newsmoke,"rbxassetid://437001004")
ChangeMeshTexture(newsmoke,"rbxassetid://437001024")
ChangeMeshSize(newsmoke,Vector3.new(0.005,0.005,0.005))
Anchor(newsmoke,false)
CreateSmoke(newsmoke);
end
local grabbed = false;
local function Grab()
local hull = workspace.Terrain:FindFirstChild("Hull")
local nearestplr = FindNearestPlayer(hull);
grabbed = true;
if grabbed == true then
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
if nearestplr.Character.HumanoidRootPart then
MovePart(nearestplr.Character.HumanoidRootPart,hull.CFrame)
end
end)
else
run:Disconnect();
end
end
local function CreateExplosion()
local part = workspace:FindFirstChild("Gigaboom")
local part2 = workspace:FindFirstChild("C4")
ChangeTransparency(part,0)
local stop = false;
MovePart(part,part2.CFrame)
ChangeTransparency(part2,1);
DestroyObject(part2);
local degreez = 0
local vectorx = 1;
local vectory = 1;
local vectorz = 1;
local localsound = Instance.new("Sound",workspace);
localsound.SoundId = "rbxassetid://2814355743"
localsound.Volume = 10
localsound:Play();
local transparency = 0;
local impact = true;
ChangeTransparency(part2,0)
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
if stop == true then
DestroyObject(workspace:FindFirstChild("Gigaboom"));
DestroyObject(workspace:FindFirstChild("C4"));
run:Disconnect();
else
Rotate(part,part.CFrame.X,part.CFrame.Y,part.CFrame.Z,0,math.rad(degreez),0)
ChangeMeshSize(part,Vector3.new(vectorx, vectory, vectorz));
ChangeTransparency(part,transparency);
transparency = transparency + 0.03
vectory = vectory + 10
vectorx = vectorx + 0.5
vectorz = vectorz + 0.5
degreez = degreez + 10
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (part2.Position - hrp.Position).Magnitude
if distance < 40 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,CFrame.new(math.random(-100,100),math.random(10,100),math.random(-100,100)))
impact = false
end
end
end
end
end
end
if transparency > 1 then
stop = true;
if workspace.Terrain:FindFirstChild("Gigaboom") then
stop = true;
DestroyObject(workspace.Terrain:FindFirstChild("Gigaboom"));
DestroyObject(workspace.Terrain:FindFirstChild("C4"));
run:Disconnect();
stop = true;
end
end
end
end)
end
local function CreateC4()
local tors = char:FindFirstChild("Torso")
CreatePart(CFrame.new(tors.CFrame.X,tors.CFrame.Y+10,tors.CFrame.Z+4),workspace)
local akakakek = GetNearestPart()
Rename(akakakek,"C4")
local newc4 = workspace:FindFirstChild("C4")
CreateMesh(newc4,"rbxassetid://437001004")
ChangeMeshTexture(newc4,"rbxassetid://437001024")
ChangeMeshSize(newc4,Vector3.new(0.005,0.005,0.005))
Anchor(newc4,false);
CreatePart(newc4.CFrame,workspace);
local partd2 = GetNearestPart();
Rename(partd2,"Gigaboom");
local part2 = workspace:FindFirstChild("Gigaboom")
ChangeTransparency(part2,1);
CreateMesh(part2,"rbxassetid://6862105399");
CanCollide(part2,false);
task.wait(3)
CreateExplosion()
end
local fpv = false;
local crowbarr = false;
local gunn = false;
local rpgg = false;
local function switchtofpv()
local hull = workspace.Terrain:FindFirstChild("Hull")
DestroyObject(hull:FindFirstChild("Mesh"));
CreateMesh(hull,"rbxassetid://127182968550642")
ChangeMeshTexture(hull,"rbxassetid://73913161706616")
ChangeMeshSize(hull,Vector3.new(0.3,0.3,0.3))
--crowbar
CreatePart(CFrame.new(hull.CFrame.X+3,hull.CFrame.Y,hull.CFrame.Z-3),workspace.Terrain)
local akakakek = GetNearestPart()
Rename(akakakek,"crowbar")
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
ChangeTransparency(crowbar,1);
CanCollide(crowbar,false)
CreateMesh(crowbar,"rbxassetid://132616338987825")
ChangeMeshTexture(crowbar,"rbxassetid://76743217167069")
ChangeMeshSize(crowbar,Vector3.new(0.3,0.3,0.3))
--gun
CreatePart(CFrame.new(hull.CFrame.X+3,hull.CFrame.Y,hull.CFrame.Z-3),workspace.Terrain)
local akakakek2 = GetNearestPart()
Rename(akakakek2,"gun")
local gun = workspace.Terrain:FindFirstChild("gun")
ChangeTransparency(gun,1);
CanCollide(gun,false)
CreateMesh(gun,"rbxassetid://430034545")
ChangeMeshTexture(gun,"rbxassetid://430034547")
ChangeMeshSize(gun,Vector3.new(0.3,0.3,0.3))
--rpg
CreatePart(CFrame.new(hull.CFrame.X+3,hull.CFrame.Y,hull.CFrame.Z-3),workspace.Terrain)
local akakakek2 = GetNearestPart()
Rename(akakakek2,"rpg")
local rpg = workspace.Terrain:FindFirstChild("rpg")
ChangeTransparency(rpg,1);
CanCollide(rpg,false)
CreateMesh(rpg,"rbxassetid://9742460834")
ChangeMeshTexture(rpg,"rbxassetid://9742460902")
ChangeMeshSize(rpg,Vector3.new(0.3,0.3,0.3))
for i,v in char:GetChildren() do
if v.Name == "Head" then
ChangeTransparency(v,0);
end
end
fpv = true;
end
createcouch.Activated:Connect(function()
CreateCouch();
end)
createsmoke.Activated:Connect(function()
CSmoke();
end)
createc4.Activated:Connect(function()
CreateC4();
end)
grab.Activated:Connect(function()
if grabbed == false then
Grab();
else
grabbed = false
end
end)
local head = char:FindFirstChild("Head")
local function updateTurretRotation()
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local gun = workspace.Terrain:FindFirstChild("gun")
local rpg = workspace.Terrain:FindFirstChild("rpg")
local cameraCFrame = workspace.Camera.CFrame
local headCFrame = char.Head.CFrame
local torsoCFrame = char.Torso.CFrame
local lookVector = cameraCFrame.LookVector
local rightVector = cameraCFrame.RightVector
local oppositeVector = Vector3.new(-lookVector.X, 0, -lookVector.Z).Unit
local anglesX, anglesY, anglesZ = 0, math.atan2(oppositeVector.X, oppositeVector.Z), 0
if fpv == true then
Rotate(hull, torsoCFrame.Position.X, torsoCFrame.Position.Y-2, torsoCFrame.Position.Z, anglesX, anglesY, anglesZ)
else
Rotate(hull, headCFrame.Position.X, headCFrame.Position.Y + 3, headCFrame.Position.Z, anglesX, anglesY, anglesZ)
end
if crowbarr == true then
Rotate(crowbar, hull.Position.X+3, hull.Position.Y, hull.Position.Z-3, anglesX, anglesY, anglesZ)
end
if gunn == true then
Rotate(gun, hull.Position.X+3, hull.Position.Y, hull.Position.Z-3, anglesX, anglesY, anglesZ)
end
if rpgg == true then
Rotate(rpg, hull.Position.X+3, hull.Position.Y, hull.Position.Z-3, anglesX, anglesY, anglesZ)
end
end
local function calculateDirection(gunPosition, mouseHitPosition)
local direction = (mouseHitPosition - gunPosition).Unit
return direction
end
local function calculateAngles(direction)
local angleX = math.atan2(-direction.X, math.sqrt(direction.Y^2 + direction.Z^2))
local angleY = math.asin(direction.Y)
local angleZ = math.atan2(-direction.Z, direction.Y)
return angleX, angleY, angleZ
end
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local mouse = game:GetService("Players").LocalPlayer:GetMouse()
local function CreateBullet()
local gun = workspace.Terrain:FindFirstChild("gun")
CreatePart(CFrame.new(gun.CFrame.X,gun.CFrame.Y,gun.CFrame.Z),workspace.Terrain)
local akakakek = GetNearestPart()
local randomname = math.random(0,1000)
Rename(akakakek,tostring(randomname))
local bullet = workspace.Terrain:FindFirstChild(tostring(randomname))
CanCollide(bullet,false)
ResizeObject(bullet,bullet.CFrame,Vector3.new(1,1,1))
CreateSpotLight(bullet);
ChangeBrightness(bullet);
ChangeBrightnessAngle(bullet,360);
local mouseHitPosition = mouse.Hit.Position
local gunPosition = gun.Position
local direction = calculateDirection(gunPosition, mouseHitPosition)
local angleX, angleY, angleZ = calculateAngles(direction)
Rotate(bullet, gunPosition.X, gunPosition.Y, gunPosition.Z, angleX, angleY, angleZ)
local distance = (mouseHitPosition - gunPosition).Magnitude
local speed = 100
local time = distance / speed
local startTime = tick()
local currentPosition = gunPosition
while tick() - startTime < time do
local t = (tick() - startTime) / time
local newPosition = gunPosition:Lerp(mouseHitPosition, t)
local newDirection = (newPosition - currentPosition).Unit
local newAngleX, newAngleY, newAngleZ = calculateAngles(newDirection)
Rotate(bullet, newPosition.X, newPosition.Y, newPosition.Z, newAngleX, newAngleY, newAngleZ)
currentPosition = newPosition
for _, player in pairs(Players:GetPlayers()) do
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
local distanceToPlayer = (bullet.Position - player.Character.HumanoidRootPart.Position).Magnitude
if distanceToPlayer <= 20 then
if player.Name == game.Players.LocalPlayer.Name then
else
DestroyObject(player.Character:FindFirstChild("Head"))
DestroyObject(bullet)
return
end
end
end
end
local maxDistance = 150
if (bullet.Position - gunPosition).Magnitude > maxDistance then
DestroyObject(bullet)
return
end
RunService.RenderStepped:wait()
end
DestroyObject(bullet)
end
local function CreateRocket()
local rpg = workspace.Terrain:FindFirstChild("rpg")
CreatePart(CFrame.new(rpg.CFrame.X,rpg.CFrame.Y,rpg.CFrame.Z),workspace.Terrain)
local akakakek = GetNearestPart()
local randomname = math.random(0,1000)
Rename(akakakek,tostring(randomname))
local rocket = workspace.Terrain:FindFirstChild(tostring(randomname))
CreateMesh(rocket,"rbxassetid://454821348")
ChangeMeshTexture(rocket,"rbxassetid://454821354")
CanCollide(rocket,false)
ChangeMeshSize(rocket,Vector3.new(0.01,0.01,0.01))
ResizeObject(rocket,rocket.CFrame,Vector3.new(1,1,1))
local mouseHitPosition = mouse.Hit.Position
local gunPosition = rpg.Position
local direction = calculateDirection(gunPosition, mouseHitPosition)
local angleX, angleY, angleZ = calculateAngles(direction)
Rotate(rocket, gunPosition.X, gunPosition.Y, gunPosition.Z, angleX, angleY, angleZ)
CreatePart(rocket.CFrame,workspace.Terrain);
local partd2 = GetNearestPart();
local randomname2 = math.random(0,1000)
Rename(partd2,"hui");
local boom = workspace.Terrain:FindFirstChild("hui")
ChangeTransparency(boom,0.5);
CreateMesh(boom,"rbxassetid://6862105399");
CanCollide(boom,false);
local distance = (mouseHitPosition - gunPosition).Magnitude
local speed = 100
local time = distance / speed
local startTime = tick()
local currentPosition = gunPosition
local transparency = 0
local vectory = 0
local vectorx = 0
local vectorz = 0
local degreez = 0
local doonce = false;
local stop = false;
local impact = true;
ChangeTransparency(boom,0)
local run
while tick() - startTime < time do
if stop == true then
DestroyObject(workspace.Terrain:FindFirstChild(boom));
DestroyObject(workspace.Terrain:FindFirstChild(rocket));
else
local t = (tick() - startTime) / time
local newPosition = gunPosition:Lerp(mouseHitPosition, t)
local newDirection = (newPosition - currentPosition).Unit
local newAngleX, newAngleY, newAngleZ = calculateAngles(newDirection)
Rotate(rocket, newPosition.X, newPosition.Y, newPosition.Z, newAngleX, newAngleY, newAngleZ)
currentPosition = newPosition
for _, player in pairs(Players:GetPlayers()) do
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
local distanceToPlayer = (rocket.Position - player.Character.HumanoidRootPart.Position).Magnitude
if distanceToPlayer <= 20 then
if player.Name == game.Players.LocalPlayer.Name then
else
run = game:GetService("RunService").Heartbeat:Connect(function()
if stop == true then
DestroyObject(workspace.Terrain:FindFirstChild(boom));
DestroyObject(workspace.Terrain:FindFirstChild(rocket));
run:Disconnect();
else
Rotate(boom,rocket.CFrame.X,rocket.CFrame.Y,rocket.CFrame.Z,0,math.rad(degreez),0)
ChangeMeshSize(boom,Vector3.new(vectorx, vectory, vectorz));
ChangeTransparency(boom,transparency);
transparency = transparency + 0.03
vectory = vectory + 10
vectorx = vectorx + 0.5
vectorz = vectorz + 0.5
degreez = degreez + 10
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (boom.Position - hrp.Position).Magnitude
if distance < 40 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,CFrame.new(math.random(-100,100),math.random(10,100),math.random(-100,100)))
impact = false
end
end
end
end
end
end
if transparency > 1 then
stop = true;
if workspace.Terrain:FindFirstChild(boom) or workspace.Terrain:FindFirstChild(rocket) then
stop = true;
DestroyObject(workspace.Terrain:FindFirstChild(boom));
DestroyObject(workspace.Terrain:FindFirstChild(rocket));
run:Disconnect();
stop = true;
end
end
end
end)
end
end
end
end
return
end
local maxDistance = 150
if (rocket.Position - gunPosition).Magnitude > maxDistance then
DestroyObject(rocket)
return
end
RunService.RenderStepped:wait()
end
DestroyObject(rocket)
end
local function UseCrowbar()
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local mouse = LocalPlayer:GetMouse()
MovePart(crowbar, CFrame.new(mouse.Hit.Position));
local hitpart = GetNearestPartTo(crowbar)
DestroyObject(hitpart)
end
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.C then
if (not gameprocess) then
if fpv == false then
switchtofpv()
end
end
end
end)
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.V then
if (not gameprocess) then
if fpv == true then
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local gun = workspace.Terrain:FindFirstChild("gun")
local rpg = workspace.Terrain:FindFirstChild("rpg")
if crowbar.Transparency == 1 then
crowbarr = true
gunn = false
rpgg = false
ChangeTransparency(crowbar,0)
ChangeTransparency(gun,1)
ChangeTransparency(rpg,1)
else
crowbarr = false;
ChangeTransparency(crowbar,1)
end
end
end
end
end)
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.B then
if (not gameprocess) then
if fpv == true then
local gun = workspace.Terrain:FindFirstChild("gun")
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local rpg = workspace.Terrain:FindFirstChild("rpg")
if gun.Transparency == 1 then
gunn = true
crowbarr = false
rpgg = false
ChangeTransparency(gun,0)
ChangeTransparency(crowbar,1)
ChangeTransparency(rpg,1)
else
gunn = false;
ChangeTransparency(gun,1)
end
end
end
end
end)
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.X then
if (not gameprocess) then
if fpv == true then
local gun = workspace.Terrain:FindFirstChild("gun")
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local rpg = workspace.Terrain:FindFirstChild("rpg")
if rpg.Transparency == 1 then
gunn = false
crowbarr = false
rpgg = true
ChangeTransparency(gun,1)
ChangeTransparency(crowbar,1)
ChangeTransparency(rpg,0)
else
rpgg = false;
ChangeTransparency(rpg,1)
end
end
end
end
end)
UserInputService.InputBegan:Connect(function(input, gameprocess)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if (not gameprocess) then
if gunn == true then
CreateBullet()
end
if crowbarr == true then
UseCrowbar()
end
if rpgg == true then
CreateRocket()
end
end
end
end)
local vfly = false
local FLYING = false
local QEfly = true
local iyflyspeed = 1
local vehicleflyspeed = 1
function NOFLY()
FLYING = false
if flyKeyDown or flyKeyUp then flyKeyDown:Disconnect() flyKeyUp:Disconnect() end
if Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid') then
Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid').PlatformStand = false
end
pcall(function() workspace.CurrentCamera.CameraType = Enum.CameraType.Custom end)
end
local function CheckDeath()
if LocalPlayer.Character.Humanoid.Health < 100 then
if fpv == true then
local gun = workspace.Terrain:FindFirstChild("gun")
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local rpg = workspace.Terrain:FindFirstChild("rpg")
local hull = workspace.Terrain:FindFirstChild("Hull")
NOFLY()
DestroyObject(rpg)
DestroyObject(hull)
DestroyObject(crowbar)
DestroyObject(gun)
else
NOFLY()
DestroyObject(hull)
end
end
end
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
updateTurretRotation()
CheckDeath()
end)
IYMouse = Players.LocalPlayer:GetMouse()
function getRoot(char)
local rootPart = char:FindFirstChild('HumanoidRootPart') or char:FindFirstChild('Torso') or char:FindFirstChild('UpperTorso')
return rootPart
end
function sFLY(vfly)
repeat wait() until Players.LocalPlayer and Players.LocalPlayer.Character and getRoot(Players.LocalPlayer.Character) and Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
repeat wait() until IYMouse
if flyKeyDown or flyKeyUp then flyKeyDown:Disconnect() flyKeyUp:Disconnect() end
local T = getRoot(Players.LocalPlayer.Character)
local CONTROL = {F = 0, B = 0, L = 0, R = 0, Q = 0, E = 0}
local lCONTROL = {F = 0, B = 0, L = 0, R = 0, Q = 0, E = 0}
local SPEED = 0
local function FLY()
FLYING = true
local BG = Instance.new('BodyGyro')
local BV = Instance.new('BodyVelocity')
BG.P = 9e4
BG.Parent = T
BV.Parent = T
BG.maxTorque = Vector3.new(9e9, 9e9, 9e9)
BG.cframe = T.CFrame
BV.velocity = Vector3.new(0, 0, 0)
BV.maxForce = Vector3.new(9e9, 9e9, 9e9)
task.spawn(function()
repeat wait()
if not vfly and Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid') then
Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid').PlatformStand = true
end
if CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0 or CONTROL.Q + CONTROL.E ~= 0 then
SPEED = 50
elseif not (CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0 or CONTROL.Q + CONTROL.E ~= 0) and SPEED ~= 0 then
SPEED = 0
end
if (CONTROL.L + CONTROL.R) ~= 0 or (CONTROL.F + CONTROL.B) ~= 0 or (CONTROL.Q + CONTROL.E) ~= 0 then
BV.velocity = ((workspace.CurrentCamera.CoordinateFrame.lookVector * (CONTROL.F + CONTROL.B)) + ((workspace.CurrentCamera.CoordinateFrame * CFrame.new(CONTROL.L + CONTROL.R, (CONTROL.F + CONTROL.B + CONTROL.Q + CONTROL.E) * 0.2, 0).p) - workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
lCONTROL = {F = CONTROL.F, B = CONTROL.B, L = CONTROL.L, R = CONTROL.R}
elseif (CONTROL.L + CONTROL.R) == 0 and (CONTROL.F + CONTROL.B) == 0 and (CONTROL.Q + CONTROL.E) == 0 and SPEED ~= 0 then
BV.velocity = ((workspace.CurrentCamera.CoordinateFrame.lookVector * (lCONTROL.F + lCONTROL.B)) + ((workspace.CurrentCamera.CoordinateFrame * CFrame.new(lCONTROL.L + lCONTROL.R, (lCONTROL.F + lCONTROL.B + CONTROL.Q + CONTROL.E) * 0.2, 0).p) - workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
else
BV.velocity = Vector3.new(0, 0, 0)
end
BG.cframe = workspace.CurrentCamera.CoordinateFrame
until not FLYING
CONTROL = {F = 0, B = 0, L = 0, R = 0, Q = 0, E = 0}
lCONTROL = {F = 0, B = 0, L = 0, R = 0, Q = 0, E = 0}
SPEED = 0
BG:Destroy()
BV:Destroy()
if Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid') then
Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid').PlatformStand = false
end
end)
end
flyKeyDown = IYMouse.KeyDown:Connect(function(KEY)
if KEY:lower() == 'w' then
CONTROL.F = (vfly and vehicleflyspeed or iyflyspeed)
elseif KEY:lower() == 's' then
CONTROL.B = - (vfly and vehicleflyspeed or iyflyspeed)
elseif KEY:lower() == 'a' then
CONTROL.L = - (vfly and vehicleflyspeed or iyflyspeed)
elseif KEY:lower() == 'd' then
CONTROL.R = (vfly and vehicleflyspeed or iyflyspeed)
elseif QEfly and KEY:lower() == 'e' then
CONTROL.Q = (vfly and vehicleflyspeed or iyflyspeed)*2
elseif QEfly and KEY:lower() == 'q' then
CONTROL.E = -(vfly and vehicleflyspeed or iyflyspeed)*2
end
pcall(function() workspace.CurrentCamera.CameraType = Enum.CameraType.Track end)
end)
flyKeyUp = IYMouse.KeyUp:Connect(function(KEY)
if KEY:lower() == 'w' then
CONTROL.F = 0
elseif KEY:lower() == 's' then
CONTROL.B = 0
elseif KEY:lower() == 'a' then
CONTROL.L = 0
elseif KEY:lower() == 'd' then
CONTROL.R = 0
elseif KEY:lower() == 'e' then
CONTROL.Q = 0
elseif KEY:lower() == 'q' then
CONTROL.E = 0
end
end)
FLY()
end
sFLY()
end
local function dofreemanr15()
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local char = LocalPlayer.Character
local Event = LocalPlayer.Backpack:FindFirstChild("Building Tools").SyncAPI.ServerEndpoint
local UIS = game:GetService("UserInputService")
local function CreatePart(position,parent)
Event:InvokeServer("CreatePart", "Normal", position, parent)
end
local function CreateBall(position,parent)
Event:InvokeServer("CreatePart", "Ball", position, parent)
end
local function CreateCylinder(position,parent)
Event:InvokeServer("CreatePart", "Cylinder", position, parent)
end
--workspace.Part
local function CreateMesh(part,meshid)
local args = {
[1] = "CreateMeshes",
[2] = {
[1] = {
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["MeshType"] = Enum.MeshType.FileMesh,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["MeshId"] = meshid
}
}
}
Event:InvokeServer(unpack(args))
end
local function CanCollide(part,cancollide)
local args = {
[1] = "SyncCollision",
[2] = {
[1] = {
["Part"] = part,
["CanCollide"] = cancollide
}
}
}
Event:InvokeServer(unpack(args))
end
local function Anchor(part,anchor)
local args = {
[1] = "SyncAnchor",
[2] = {
[1] = {
["Part"] = part,
["Anchored"] = anchor
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rotate(part,degreex,degreey,degreez,anglesx,anglesy,anglesz)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = CFrame.new(degreex, degreey, degreez) * CFrame.Angles(anglesx, anglesy,anglesz)
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshSize(part,vector3size)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["Scale"] = vector3size
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeTransparency(part,transparency)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Transparency"] = transparency
}
}
}
Event:InvokeServer(unpack(args))
end
local function WeldTo(parttoweld,parttoweldto)
local args = {
[1] = "CreateWelds",
[2] = {
[1] = parttoweld
},
[3] = parttoweldto
}
Event:InvokeServer(unpack(args))
end
local function BreakWeld(weldtobreak)
local args = {
[1] = "RemoveWelds",
[2] = {weldtobreak}
}
Event:InvokeServer(unpack(args))
end
local function MovePart(part,cframe)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateFire(part)
local args = {
[1] = "CreateDecorations",
[2] = {
[1] = {
["Part"] = part,
["DecorationType"] = "Fire"
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshTexture(part,textureid)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["TextureId"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeColor(part,unioncoloringenabled,color)
local args = {
[1] = "SyncColor",
[2] = {
[1] = {
["Color"] = color,
["UnionColoring"] = unioncoloringenabled,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rename(part,name)
local args = {
[1] = "SetName",
[2] = {
[1] = part
},
[3] = name
}
Event:InvokeServer(unpack(args))
end
local function DestroyObject(part)
local args = {
[1] = "Remove",
[2] = {
[1] = part
}
}
Event:InvokeServer(unpack(args))
end
local function ResizeObject(part,cframe,vector3)
local args = {
[1] = "SyncResize",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe,
["Size"] = vector3
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeNeon(part)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Material"] = Enum.Material.Neon
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeDecal(part,face,textureid)
local args = {
[1] = "CreateTextures",
[2] = {
[1] = {
["Part"] = part,
["Face"] = face, -- Front, Top, Bottom, Front, Back, Left, Right
["TextureType"] = "Decal"
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncTexture",
[2] = {
[1] = {
["Part"] = part,
["Face"] = face, -- Front, Top, Bottom, Front, Back, Left, Right
["TextureType"] = "Decal",
["Texture"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateSmoke(part)
local args = {
[1] = "CreateDecorations",
[2] = {
[1] = {
["Part"] = part,
["DecorationType"] = "Smoke"
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateSpotLight(part)
local args = {
[1] = "CreateLights",
[2] = {
[1] = {
["Part"] = part,
["LightType"] = "SpotLight" -- Spot light, Point light, Surface light
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeBrightness(part)
local args = {
[1] = "SyncLighting",
[2] = {
[1] = {
["Part"] = part,
["LightType"] = "SpotLight", -- or "SpotLight"
["Brightness"] = 10
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeBrightnessAngle(part,angle)
local args = {
[1] = "SyncLighting",
[2] = {
[1] = {
["Part"] = part,
["LightType"] = "SpotLight", -- or "SpotLight"
["Angle"] = angle
}
}
}
Event:InvokeServer(unpack(args))
end
-- Function to find the nearest player
local function FindNearestPlayer(soldier)
local nearestPlayer = nil
local nearestDistance = math.huge
for _, player in pairs(game.Players:GetPlayers()) do
local character = player.Character
if character then
if character.HumanoidRootPart then
local distance = (character.HumanoidRootPart.Position - soldier.Position).Magnitude
if distance < nearestDistance then
if player.Name == game.Players.LocalPlayer.Name then
else
nearestDistance = distance
nearestPlayer = player
end
end
end
end
end
return nearestPlayer
end
local function GetNearestPart()
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("HumanoidRootPart")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (RightArm.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
return nearestPart
end
local function GetNearestPartTo(soldier)
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("HumanoidRootPart")
if RightArm then
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") or part:IsA("MeshPart") then
if part.Name == "crowbar" or part.Name == "Hull" or part.Name == "gun" or part.Name == "rpg" or part.Parent == game.Players.LocalPlayer.Character then
else
local distance = (soldier.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
end
end
end
end
end
return nearestPart
end
---------freeman script---------------------
if char:FindFirstChild("Animate") then
char:FindFirstChild("Animate"):Destroy()
end
for i,v in char:GetChildren() do
if v:IsA("Accessory") then
v:Destroy()
elseif v:IsA("Part") or v:IsA("MeshPart") then
ChangeTransparency(v,1);
end
end
if char:FindFirstChild("Head"):FindFirstChild("face") then
DestroyObject(char:FindFirstChild("Head"):FindFirstChild("face"));
end
---ye-----------------------------------
CreatePart(char:FindFirstChild("UpperTorso").CFrame,workspace.Terrain)
local akakak = GetNearestPart()
CanCollide(akakak,false)
Rename(akakak,"Hull")
local hull = workspace.Terrain:FindFirstChild("Hull")
CreateMesh(hull,"rbxassetid://12903182903")
ChangeMeshTexture(hull,"rbxassetid://1202034198")
ChangeMeshSize(hull,Vector3.new(0.2,0.2,0.2))
local createcouch = Instance.new("Tool",char)
createcouch.Enabled = true
createcouch.RequiresHandle = false
createcouch.Name = "CreateCouch"
local createsmoke = Instance.new("Tool",char)
createsmoke.Enabled = true
createsmoke.RequiresHandle = false
createsmoke.Name = "CreateSmoke"
local createc4 = Instance.new("Tool",char)
createc4.Enabled = true
createc4.RequiresHandle = false
createc4.Name = "CreateC4"
local grab = Instance.new("Tool",char)
grab.Enabled = true
grab.RequiresHandle = false
grab.Name = "Grab"
local function CreateCouch()
local tors = char:FindFirstChild("UpperTorso")
CreatePart(CFrame.new(tors.CFrame.X,tors.CFrame.Y+10,tors.CFrame.Z+4),workspace.Terrain)
local akakakek = GetNearestPart()
local randomname = math.random(1,1000);
Rename(akakakek,tostring(randomname))
local newcouch = workspace.Terrain:FindFirstChild(tostring(randomname))
CreateMesh(newcouch,"rbxassetid://437989588")
ChangeMeshTexture(newcouch,"rbxassetid://437989607")
ChangeMeshSize(newcouch,Vector3.new(0.001,0.001,0.001))
Anchor(newcouch,false)
end
local function CSmoke()
local tors = char:FindFirstChild("UpperTorso")
CreatePart(CFrame.new(tors.CFrame.X,tors.CFrame.Y+10,tors.CFrame.Z+4),workspace.Terrain)
local akakakek = GetNearestPart()
local randomname = math.random(1,1000);
Rename(akakakek,tostring(randomname))
local newsmoke = workspace.Terrain:FindFirstChild(tostring(randomname))
CreateMesh(newsmoke,"rbxassetid://437001004")
ChangeMeshTexture(newsmoke,"rbxassetid://437001024")
ChangeMeshSize(newsmoke,Vector3.new(0.005,0.005,0.005))
Anchor(newsmoke,false)
CreateSmoke(newsmoke);
end
local grabbed = false;
local function Grab()
local hull = workspace.Terrain:FindFirstChild("Hull")
local nearestplr = FindNearestPlayer(hull);
grabbed = true;
if grabbed == true then
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
if nearestplr.Character.HumanoidRootPart then
MovePart(nearestplr.Character.HumanoidRootPart,hull.CFrame)
end
end)
else
run:Disconnect();
end
end
local function CreateExplosion()
local part = workspace:FindFirstChild("Gigaboom")
local part2 = workspace:FindFirstChild("C4")
ChangeTransparency(part,0)
local stop = false;
MovePart(part,part2.CFrame)
ChangeTransparency(part2,1);
DestroyObject(part2);
local degreez = 0
local vectorx = 1;
local vectory = 1;
local vectorz = 1;
local localsound = Instance.new("Sound",workspace);
localsound.SoundId = "rbxassetid://2814355743"
localsound.Volume = 10
localsound:Play();
local transparency = 0;
local impact = true;
ChangeTransparency(part2,0)
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
if stop == true then
DestroyObject(workspace:FindFirstChild("Gigaboom"));
DestroyObject(workspace:FindFirstChild("C4"));
run:Disconnect();
else
Rotate(part,part.CFrame.X,part.CFrame.Y,part.CFrame.Z,0,math.rad(degreez),0)
ChangeMeshSize(part,Vector3.new(vectorx, vectory, vectorz));
ChangeTransparency(part,transparency);
transparency = transparency + 0.03
vectory = vectory + 10
vectorx = vectorx + 0.5
vectorz = vectorz + 0.5
degreez = degreez + 10
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (part2.Position - hrp.Position).Magnitude
if distance < 40 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,CFrame.new(math.random(-100,100),math.random(10,100),math.random(-100,100)))
impact = false
end
end
end
end
end
end
if transparency > 1 then
stop = true;
if workspace.Terrain:FindFirstChild("Gigaboom") then
stop = true;
DestroyObject(workspace.Terrain:FindFirstChild("Gigaboom"));
DestroyObject(workspace.Terrain:FindFirstChild("C4"));
run:Disconnect();
stop = true;
end
end
end
end)
end
local function CreateC4()
local tors = char:FindFirstChild("UpperTorso")
CreatePart(CFrame.new(tors.CFrame.X,tors.CFrame.Y+10,tors.CFrame.Z+4),workspace)
local akakakek = GetNearestPart()
Rename(akakakek,"C4")
local newc4 = workspace:FindFirstChild("C4")
CreateMesh(newc4,"rbxassetid://437001004")
ChangeMeshTexture(newc4,"rbxassetid://437001024")
ChangeMeshSize(newc4,Vector3.new(0.005,0.005,0.005))
Anchor(newc4,false);
CreatePart(newc4.CFrame,workspace);
local partd2 = GetNearestPart();
Rename(partd2,"Gigaboom");
local part2 = workspace:FindFirstChild("Gigaboom")
ChangeTransparency(part2,1);
CreateMesh(part2,"rbxassetid://6862105399");
CanCollide(part2,false);
task.wait(3)
CreateExplosion()
end
local fpv = false;
local crowbarr = false;
local gunn = false;
local rpgg = false;
local function switchtofpv()
local hull = workspace.Terrain:FindFirstChild("Hull")
DestroyObject(hull:FindFirstChild("Mesh"));
CreateMesh(hull,"rbxassetid://127182968550642")
ChangeMeshTexture(hull,"rbxassetid://73913161706616")
ChangeMeshSize(hull,Vector3.new(0.3,0.3,0.3))
--crowbar
CreatePart(CFrame.new(hull.CFrame.X+3,hull.CFrame.Y,hull.CFrame.Z-3),workspace.Terrain)
local akakakek = GetNearestPart()
Rename(akakakek,"crowbar")
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
ChangeTransparency(crowbar,1);
CanCollide(crowbar,false)
CreateMesh(crowbar,"rbxassetid://132616338987825")
ChangeMeshTexture(crowbar,"rbxassetid://76743217167069")
ChangeMeshSize(crowbar,Vector3.new(0.3,0.3,0.3))
--gun
CreatePart(CFrame.new(hull.CFrame.X+3,hull.CFrame.Y,hull.CFrame.Z-3),workspace.Terrain)
local akakakek2 = GetNearestPart()
Rename(akakakek2,"gun")
local gun = workspace.Terrain:FindFirstChild("gun")
ChangeTransparency(gun,1);
CanCollide(gun,false)
CreateMesh(gun,"rbxassetid://430034545")
ChangeMeshTexture(gun,"rbxassetid://430034547")
ChangeMeshSize(gun,Vector3.new(0.3,0.3,0.3))
--rpg
CreatePart(CFrame.new(hull.CFrame.X+3,hull.CFrame.Y,hull.CFrame.Z-3),workspace.Terrain)
local akakakek2 = GetNearestPart()
Rename(akakakek2,"rpg")
local rpg = workspace.Terrain:FindFirstChild("rpg")
ChangeTransparency(rpg,1);
CanCollide(rpg,false)
CreateMesh(rpg,"rbxassetid://9742460834")
ChangeMeshTexture(rpg,"rbxassetid://9742460902")
ChangeMeshSize(rpg,Vector3.new(0.3,0.3,0.3))
for i,v in char:GetChildren() do
if v.Name == "Head" then
ChangeTransparency(v,0);
end
end
fpv = true;
end
createcouch.Activated:Connect(function()
CreateCouch();
end)
createsmoke.Activated:Connect(function()
CSmoke();
end)
createc4.Activated:Connect(function()
CreateC4();
end)
grab.Activated:Connect(function()
if grabbed == false then
Grab();
else
grabbed = false
end
end)
local head = char:FindFirstChild("Head")
local function updateTurretRotation()
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local gun = workspace.Terrain:FindFirstChild("gun")
local rpg = workspace.Terrain:FindFirstChild("rpg")
local cameraCFrame = workspace.Camera.CFrame
local headCFrame = char.Head.CFrame
local UpperTorsoCFrame = char.UpperTorso.CFrame
local lookVector = cameraCFrame.LookVector
local rightVector = cameraCFrame.RightVector
local oppositeVector = Vector3.new(-lookVector.X, 0, -lookVector.Z).Unit
local anglesX, anglesY, anglesZ = 0, math.atan2(oppositeVector.X, oppositeVector.Z), 0
if fpv == true then
Rotate(hull, UpperTorsoCFrame.Position.X, UpperTorsoCFrame.Position.Y-2, UpperTorsoCFrame.Position.Z, anglesX, anglesY, anglesZ)
else
Rotate(hull, headCFrame.Position.X, headCFrame.Position.Y + 3, headCFrame.Position.Z, anglesX, anglesY, anglesZ)
end
if crowbarr == true then
Rotate(crowbar, hull.Position.X+3, hull.Position.Y, hull.Position.Z-3, anglesX, anglesY, anglesZ)
end
if gunn == true then
Rotate(gun, hull.Position.X+3, hull.Position.Y, hull.Position.Z-3, anglesX, anglesY, anglesZ)
end
if rpgg == true then
Rotate(rpg, hull.Position.X+3, hull.Position.Y, hull.Position.Z-3, anglesX, anglesY, anglesZ)
end
end
local function calculateDirection(gunPosition, mouseHitPosition)
local direction = (mouseHitPosition - gunPosition).Unit
return direction
end
local function calculateAngles(direction)
local angleX = math.atan2(-direction.X, math.sqrt(direction.Y^2 + direction.Z^2))
local angleY = math.asin(direction.Y)
local angleZ = math.atan2(-direction.Z, direction.Y)
return angleX, angleY, angleZ
end
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local mouse = game:GetService("Players").LocalPlayer:GetMouse()
local function CreateBullet()
local gun = workspace.Terrain:FindFirstChild("gun")
CreatePart(CFrame.new(gun.CFrame.X,gun.CFrame.Y,gun.CFrame.Z),workspace.Terrain)
local akakakek = GetNearestPart()
local randomname = math.random(0,1000)
Rename(akakakek,tostring(randomname))
local bullet = workspace.Terrain:FindFirstChild(tostring(randomname))
CanCollide(bullet,false)
ResizeObject(bullet,bullet.CFrame,Vector3.new(1,1,1))
CreateSpotLight(bullet);
ChangeBrightness(bullet);
ChangeBrightnessAngle(bullet,360);
local mouseHitPosition = mouse.Hit.Position
local gunPosition = gun.Position
local direction = calculateDirection(gunPosition, mouseHitPosition)
local angleX, angleY, angleZ = calculateAngles(direction)
Rotate(bullet, gunPosition.X, gunPosition.Y, gunPosition.Z, angleX, angleY, angleZ)
local distance = (mouseHitPosition - gunPosition).Magnitude
local speed = 100
local time = distance / speed
local startTime = tick()
local currentPosition = gunPosition
while tick() - startTime < time do
local t = (tick() - startTime) / time
local newPosition = gunPosition:Lerp(mouseHitPosition, t)
local newDirection = (newPosition - currentPosition).Unit
local newAngleX, newAngleY, newAngleZ = calculateAngles(newDirection)
Rotate(bullet, newPosition.X, newPosition.Y, newPosition.Z, newAngleX, newAngleY, newAngleZ)
currentPosition = newPosition
for _, player in pairs(Players:GetPlayers()) do
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
local distanceToPlayer = (bullet.Position - player.Character.HumanoidRootPart.Position).Magnitude
if distanceToPlayer <= 20 then
if player.Name == game.Players.LocalPlayer.Name then
else
DestroyObject(player.Character:FindFirstChild("Head"))
DestroyObject(bullet)
return
end
end
end
end
local maxDistance = 150
if (bullet.Position - gunPosition).Magnitude > maxDistance then
DestroyObject(bullet)
return
end
RunService.RenderStepped:wait()
end
DestroyObject(bullet)
end
local function CreateRocket()
local rpg = workspace.Terrain:FindFirstChild("rpg")
CreatePart(CFrame.new(rpg.CFrame.X,rpg.CFrame.Y,rpg.CFrame.Z),workspace.Terrain)
local akakakek = GetNearestPart()
local randomname = math.random(0,1000)
Rename(akakakek,tostring(randomname))
local rocket = workspace.Terrain:FindFirstChild(tostring(randomname))
CreateMesh(rocket,"rbxassetid://454821348")
ChangeMeshTexture(rocket,"rbxassetid://454821354")
CanCollide(rocket,false)
ChangeMeshSize(rocket,Vector3.new(0.01,0.01,0.01))
ResizeObject(rocket,rocket.CFrame,Vector3.new(1,1,1))
local mouseHitPosition = mouse.Hit.Position
local gunPosition = rpg.Position
local direction = calculateDirection(gunPosition, mouseHitPosition)
local angleX, angleY, angleZ = calculateAngles(direction)
Rotate(rocket, gunPosition.X, gunPosition.Y, gunPosition.Z, angleX, angleY, angleZ)
CreatePart(rocket.CFrame,workspace.Terrain);
local partd2 = GetNearestPart();
local randomname2 = math.random(0,1000)
Rename(partd2,"hui");
local boom = workspace.Terrain:FindFirstChild("hui")
ChangeTransparency(boom,0.5);
CreateMesh(boom,"rbxassetid://6862105399");
CanCollide(boom,false);
local distance = (mouseHitPosition - gunPosition).Magnitude
local speed = 100
local time = distance / speed
local startTime = tick()
local currentPosition = gunPosition
local transparency = 0
local vectory = 0
local vectorx = 0
local vectorz = 0
local degreez = 0
local doonce = false;
local stop = false;
local impact = true;
ChangeTransparency(boom,0)
local run
while tick() - startTime < time do
if stop == true then
DestroyObject(workspace.Terrain:FindFirstChild(boom));
DestroyObject(workspace.Terrain:FindFirstChild(rocket));
else
local t = (tick() - startTime) / time
local newPosition = gunPosition:Lerp(mouseHitPosition, t)
local newDirection = (newPosition - currentPosition).Unit
local newAngleX, newAngleY, newAngleZ = calculateAngles(newDirection)
Rotate(rocket, newPosition.X, newPosition.Y, newPosition.Z, newAngleX, newAngleY, newAngleZ)
currentPosition = newPosition
for _, player in pairs(Players:GetPlayers()) do
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
local distanceToPlayer = (rocket.Position - player.Character.HumanoidRootPart.Position).Magnitude
if distanceToPlayer <= 20 then
if player.Name == game.Players.LocalPlayer.Name then
else
run = game:GetService("RunService").Heartbeat:Connect(function()
if stop == true then
DestroyObject(workspace.Terrain:FindFirstChild(boom));
DestroyObject(workspace.Terrain:FindFirstChild(rocket));
run:Disconnect();
else
Rotate(boom,rocket.CFrame.X,rocket.CFrame.Y,rocket.CFrame.Z,0,math.rad(degreez),0)
ChangeMeshSize(boom,Vector3.new(vectorx, vectory, vectorz));
ChangeTransparency(boom,transparency);
transparency = transparency + 0.03
vectory = vectory + 10
vectorx = vectorx + 0.5
vectorz = vectorz + 0.5
degreez = degreez + 10
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (boom.Position - hrp.Position).Magnitude
if distance < 40 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,CFrame.new(math.random(-100,100),math.random(10,100),math.random(-100,100)))
impact = false
end
end
end
end
end
end
if transparency > 1 then
stop = true;
if workspace.Terrain:FindFirstChild(boom) or workspace.Terrain:FindFirstChild(rocket) then
stop = true;
DestroyObject(workspace.Terrain:FindFirstChild(boom));
DestroyObject(workspace.Terrain:FindFirstChild(rocket));
run:Disconnect();
stop = true;
end
end
end
end)
end
end
end
end
return
end
local maxDistance = 150
if (rocket.Position - gunPosition).Magnitude > maxDistance then
DestroyObject(rocket)
return
end
RunService.RenderStepped:wait()
end
DestroyObject(rocket)
end
local function UseCrowbar()
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local mouse = LocalPlayer:GetMouse()
MovePart(crowbar, CFrame.new(mouse.Hit.Position));
local hitpart = GetNearestPartTo(crowbar)
DestroyObject(hitpart)
end
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.C then
if (not gameprocess) then
if fpv == false then
switchtofpv()
end
end
end
end)
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.V then
if (not gameprocess) then
if fpv == true then
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local gun = workspace.Terrain:FindFirstChild("gun")
local rpg = workspace.Terrain:FindFirstChild("rpg")
if crowbar.Transparency == 1 then
crowbarr = true
gunn = false
rpgg = false
ChangeTransparency(crowbar,0)
ChangeTransparency(gun,1)
ChangeTransparency(rpg,1)
else
crowbarr = false;
ChangeTransparency(crowbar,1)
end
end
end
end
end)
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.B then
if (not gameprocess) then
if fpv == true then
local gun = workspace.Terrain:FindFirstChild("gun")
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local rpg = workspace.Terrain:FindFirstChild("rpg")
if gun.Transparency == 1 then
gunn = true
crowbarr = false
rpgg = false
ChangeTransparency(gun,0)
ChangeTransparency(crowbar,1)
ChangeTransparency(rpg,1)
else
gunn = false;
ChangeTransparency(gun,1)
end
end
end
end
end)
UIS.InputBegan:connect(function(input, gameprocess)
if input.KeyCode == Enum.KeyCode.X then
if (not gameprocess) then
if fpv == true then
local gun = workspace.Terrain:FindFirstChild("gun")
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local rpg = workspace.Terrain:FindFirstChild("rpg")
if rpg.Transparency == 1 then
gunn = false
crowbarr = false
rpgg = true
ChangeTransparency(gun,1)
ChangeTransparency(crowbar,1)
ChangeTransparency(rpg,0)
else
rpgg = false;
ChangeTransparency(rpg,1)
end
end
end
end
end)
UserInputService.InputBegan:Connect(function(input, gameprocess)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if (not gameprocess) then
if gunn == true then
CreateBullet()
end
if crowbarr == true then
UseCrowbar()
end
if rpgg == true then
CreateRocket()
end
end
end
end)
local vfly = false
local FLYING = false
local QEfly = true
local iyflyspeed = 1
local vehicleflyspeed = 1
function NOFLY()
FLYING = false
if flyKeyDown or flyKeyUp then flyKeyDown:Disconnect() flyKeyUp:Disconnect() end
if Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid') then
Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid').PlatformStand = false
end
pcall(function() workspace.CurrentCamera.CameraType = Enum.CameraType.Custom end)
end
local function CheckDeath()
if LocalPlayer.Character.Humanoid.Health < 100 then
if fpv == true then
local gun = workspace.Terrain:FindFirstChild("gun")
local crowbar = workspace.Terrain:FindFirstChild("crowbar")
local rpg = workspace.Terrain:FindFirstChild("rpg")
local hull = workspace.Terrain:FindFirstChild("Hull")
NOFLY()
DestroyObject(rpg)
DestroyObject(hull)
DestroyObject(crowbar)
DestroyObject(gun)
else
NOFLY()
DestroyObject(hull)
end
end
end
local run
run = game:GetService("RunService").Heartbeat:Connect(function()
updateTurretRotation()
CheckDeath()
end)
IYMouse = Players.LocalPlayer:GetMouse()
function getRoot(char)
local rootPart = char:FindFirstChild('HumanoidRootPart') or char:FindFirstChild('UpperTorso') or char:FindFirstChild('UpperUpperTorso')
return rootPart
end
function sFLY(vfly)
repeat wait() until Players.LocalPlayer and Players.LocalPlayer.Character and getRoot(Players.LocalPlayer.Character) and Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
repeat wait() until IYMouse
if flyKeyDown or flyKeyUp then flyKeyDown:Disconnect() flyKeyUp:Disconnect() end
local T = getRoot(Players.LocalPlayer.Character)
local CONTROL = {F = 0, B = 0, L = 0, R = 0, Q = 0, E = 0}
local lCONTROL = {F = 0, B = 0, L = 0, R = 0, Q = 0, E = 0}
local SPEED = 0
local function FLY()
FLYING = true
local BG = Instance.new('BodyGyro')
local BV = Instance.new('BodyVelocity')
BG.P = 9e4
BG.Parent = T
BV.Parent = T
BG.maxTorque = Vector3.new(9e9, 9e9, 9e9)
BG.cframe = T.CFrame
BV.velocity = Vector3.new(0, 0, 0)
BV.maxForce = Vector3.new(9e9, 9e9, 9e9)
task.spawn(function()
repeat wait()
if not vfly and Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid') then
Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid').PlatformStand = true
end
if CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0 or CONTROL.Q + CONTROL.E ~= 0 then
SPEED = 50
elseif not (CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0 or CONTROL.Q + CONTROL.E ~= 0) and SPEED ~= 0 then
SPEED = 0
end
if (CONTROL.L + CONTROL.R) ~= 0 or (CONTROL.F + CONTROL.B) ~= 0 or (CONTROL.Q + CONTROL.E) ~= 0 then
BV.velocity = ((workspace.CurrentCamera.CoordinateFrame.lookVector * (CONTROL.F + CONTROL.B)) + ((workspace.CurrentCamera.CoordinateFrame * CFrame.new(CONTROL.L + CONTROL.R, (CONTROL.F + CONTROL.B + CONTROL.Q + CONTROL.E) * 0.2, 0).p) - workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
lCONTROL = {F = CONTROL.F, B = CONTROL.B, L = CONTROL.L, R = CONTROL.R}
elseif (CONTROL.L + CONTROL.R) == 0 and (CONTROL.F + CONTROL.B) == 0 and (CONTROL.Q + CONTROL.E) == 0 and SPEED ~= 0 then
BV.velocity = ((workspace.CurrentCamera.CoordinateFrame.lookVector * (lCONTROL.F + lCONTROL.B)) + ((workspace.CurrentCamera.CoordinateFrame * CFrame.new(lCONTROL.L + lCONTROL.R, (lCONTROL.F + lCONTROL.B + CONTROL.Q + CONTROL.E) * 0.2, 0).p) - workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
else
BV.velocity = Vector3.new(0, 0, 0)
end
BG.cframe = workspace.CurrentCamera.CoordinateFrame
until not FLYING
CONTROL = {F = 0, B = 0, L = 0, R = 0, Q = 0, E = 0}
lCONTROL = {F = 0, B = 0, L = 0, R = 0, Q = 0, E = 0}
SPEED = 0
BG:Destroy()
BV:Destroy()
if Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid') then
Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid').PlatformStand = false
end
end)
end
flyKeyDown = IYMouse.KeyDown:Connect(function(KEY)
if KEY:lower() == 'w' then
CONTROL.F = (vfly and vehicleflyspeed or iyflyspeed)
elseif KEY:lower() == 's' then
CONTROL.B = - (vfly and vehicleflyspeed or iyflyspeed)
elseif KEY:lower() == 'a' then
CONTROL.L = - (vfly and vehicleflyspeed or iyflyspeed)
elseif KEY:lower() == 'd' then
CONTROL.R = (vfly and vehicleflyspeed or iyflyspeed)
elseif QEfly and KEY:lower() == 'e' then
CONTROL.Q = (vfly and vehicleflyspeed or iyflyspeed)*2
elseif QEfly and KEY:lower() == 'q' then
CONTROL.E = -(vfly and vehicleflyspeed or iyflyspeed)*2
end
pcall(function() workspace.CurrentCamera.CameraType = Enum.CameraType.Track end)
end)
flyKeyUp = IYMouse.KeyUp:Connect(function(KEY)
if KEY:lower() == 'w' then
CONTROL.F = 0
elseif KEY:lower() == 's' then
CONTROL.B = 0
elseif KEY:lower() == 'a' then
CONTROL.L = 0
elseif KEY:lower() == 'd' then
CONTROL.R = 0
elseif KEY:lower() == 'e' then
CONTROL.Q = 0
elseif KEY:lower() == 'q' then
CONTROL.E = 0
end
end)
FLY()
end
sFLY()
end
local function dodynr15()
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local char = LocalPlayer.Character
local Event = LocalPlayer.Backpack:FindFirstChild("Building Tools").SyncAPI.ServerEndpoint
local UIS = game:GetService("UserInputService")
local function CreatePart(position,parent)
Event:InvokeServer("CreatePart", "Normal", position, parent)
end
--workspace.Part
local function CreateMesh(part,meshid)
local args = {
[1] = "CreateMeshes",
[2] = {
[1] = {
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["MeshType"] = Enum.MeshType.FileMesh,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["MeshId"] = meshid
}
}
}
Event:InvokeServer(unpack(args))
end
local function CanCollide(part,cancollide)
local args = {
[1] = "SyncCollision",
[2] = {
[1] = {
["Part"] = part,
["CanCollide"] = cancollide
}
}
}
Event:InvokeServer(unpack(args))
end
local function Anchor(part,anchor)
local args = {
[1] = "SyncAnchor",
[2] = {
[1] = {
["Part"] = part,
["Anchored"] = anchor
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rotate(part,degreex,degreey,degreez,anglesx,anglesy,anglesz)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = CFrame.new(degreex, degreey, degreez) * CFrame.Angles(anglesx, anglesy,anglesz)
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshSize(part,vector3size)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["Scale"] = vector3size
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeTransparency(part,transparency)
local args = {
[1] = "SyncMaterial",
[2] = {
[1] = {
["Part"] = part,
["Transparency"] = transparency
}
}
}
Event:InvokeServer(unpack(args))
end
local function WeldTo(parttoweld,parttoweldto)
local args = {
[1] = "CreateWelds",
[2] = {
[1] = parttoweld
},
[3] = parttoweldto
}
Event:InvokeServer(unpack(args))
end
local function BreakWeld(weldtobreak)
local args = {
[1] = "RemoveWelds",
[2] = {weldtobreak}
}
Event:InvokeServer(unpack(args))
end
local function MovePart(part,cframe)
local args = {
[1] = "SyncRotate",
[2] = {
[1] = {
["Part"] = part,
["CFrame"] = cframe
}
}
}
Event:InvokeServer(unpack(args))
end
local function CreateFire(part)
local args = {
[1] = "CreateDecorations",
[2] = {
[1] = {
["Part"] = part,
["DecorationType"] = "Fire"
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeMeshTexture(part,textureid)
local args = {
[1] = "SyncMesh",
[2] = {
[1] = {
["Part"] = part,
["TextureId"] = textureid
}
}
}
Event:InvokeServer(unpack(args))
end
local function ChangeColor(part,unioncoloringenabled,color)
local args = {
[1] = "SyncColor",
[2] = {
[1] = {
["Color"] = color,
["UnionColoring"] = unioncoloringenabled,
["Part"] = part
}
}
}
Event:InvokeServer(unpack(args))
end
local function Rename(part,name)
local args = {
[1] = "SetName",
[2] = {
[1] = part
},
[3] = name
}
Event:InvokeServer(unpack(args))
end
local function DestroyObject(part)
local args = {
[1] = "Remove",
[2] = {
[1] = part
}
}
Event:InvokeServer(unpack(args))
end
local function GetNearestPart()
print("Getting nearest part...")
local nearestPart = nil
local nearestDistance = math.huge
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local RightArm = localCharacter:FindFirstChild("RightHand")
if RightArm then
print("Found RightArm...")
for _, part in pairs(workspace:GetDescendants()) do
if part:IsA("Part") and part.Name == "Part" then
local distance = (RightArm.Position - part.Position).Magnitude
if distance < nearestDistance then
nearestDistance = distance
nearestPart = part
print("Found nearest part: " .. tostring(nearestPart))
end
end
end
end
return nearestPart
end
local function createhammer(player)
CreatePart(player.Character:FindFirstChild("RightHand").CFrame,workspace);
local partd = GetNearestPart();
Rename(partd,"Gigachad")
local part = workspace:WaitForChild("Gigachad")
Rotate(part,part.CFrame.X,part.CFrame.Y,part.CFrame.Z,0,0,math.rad(90))
WeldTo(part,player.Character:FindFirstChild("RightHand"));
CreateMesh(part,"rbxassetid://10172112489");
ChangeMeshTexture(part,"rbxassetid://10172112542");
ChangeMeshSize(part,Vector3.new(0.1,0.1,0.1));
CanCollide(part,false);
Anchor(part,false);
local touched = false;
local dropstate = false;
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.C then
if dropstate == true then
--do nothin
else
if player.Character:FindFirstChild("RightHand").BTWeld then
BreakWeld(player.Character:FindFirstChild("RightHand").BTWeld);
else
BreakWeld(part.BTWeld);
end
MovePart(part,CFrame.new(part.CFrame.X,part.CFrame.Y,part.CFrame.Z+2))
CanCollide(part,true);
CreateFire(part);
dropstate = true;
end
end
end)
part.Touched:Connect(function(toucher)
if dropstate == true then
if not touched then
touched = true
task.wait(2) --detonation secs
CreatePart(part.CFrame,workspace);
local partd2 = GetNearestPart();
ChangeTransparency(part,1);
DestroyObject(part);
Rename(partd2,"Gigaboom");
local part2 = workspace:WaitForChild("Gigaboom")
CreateMesh(part2,"rbxassetid://6862105399");
CanCollide(part2,false);
Anchor(part2,true);
local degreez = 0
local vectorx = 1;
local vectory = 1;
local vectorz = 1;
local localsound = Instance.new("Sound",workspace);
localsound.SoundId = "rbxassetid://2814355743"
localsound.Volume = 10
localsound:Play();
local transparency = 0;
local impact = true;
while task.wait(0.01) do
Rotate(part2,part2.CFrame.X,part2.CFrame.Y,part2.CFrame.Z,0,math.rad(degreez),0)
ChangeMeshSize(part2,Vector3.new(vectorx, vectory, vectorz));
ChangeTransparency(part2,transparency);
transparency = transparency + 0.05
vectory = vectory + 10
vectorx = vectorx + 1
vectorz = vectorz + 1
degreez = degreez + 10
if impact == true then
for i,v in game.Players:GetPlayers() do
local chark = v.Character
if chark then
local head = chark:FindFirstChild("Head")
local hrp = chark:FindFirstChild("HumanoidRootPart")
if head and hrp then
local distance = (part2.Position - hrp.Position).Magnitude
if distance < 30 then
if v.Name == game.Players.LocalPlayer.Name then
--whitelisted
else
MovePart(head,CFrame.new(math.random(-100,100),math.random(10,100),math.random(-100,100)))
impact = false
end
end
end
end
end
end
if transparency > 1.3 then
local part3 = workspace:WaitForChild("Gigaboom");
DestroyObject(part3);
break
end
end
end
end
end)
end
createhammer(game.Players.LocalPlayer)
end
control.MouseButton1Down:Connect(function()
controlstext.Visible = not controlstext.Visible;
end)
Frame.Draggable = true;
Frame.Active = true;
xr6.MouseButton1Down:Connect(function()
doxesterr6()
end)
dynr6.MouseButton1Down:Connect(function()
dodynr6()
end)
visr6.MouseButton1Down:Connect(function()
dovisr6()
end)
soldierr6.MouseButton1Down:Connect(function()
dosoldierr6()
end)
freemanr6.MouseButton1Down:Connect(function()
dofreemanr6()
end)
freemanr15.MouseButton1Down:Connect(function()
dofreemanr15()
end)
dynr15.MouseButton1Down:Connect(function()
dodynr15()
end)Features
- uses btools (f3x) to make stuff that is fe (other players can see)