Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print'https://pastebin.com/raw/z7tarq7m'
- --by CHL
- --Converted with ttyyuu12345's model to script plugin v4
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- RemoteEvent5 = Instance.new("RemoteEvent")
- Sound6 = Instance.new("Sound")
- Tool0.Name = "Cake Gun"
- Tool0.Grip = CFrame.new(0, 0, 0.600000024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Tool0.GripPos = Vector3.new(0, 0, 0.600000024)
- Tool0.ToolTip = "Is it cake? You scream for you do not know. (Based on the cakeifier from Bloody Battle)"
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.CFrame = CFrame.new(0, 0.5, 30, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.Position = Vector3.new(0, 0.5, 30)
- Part1.Size = Vector3.new(1, 1, 1)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=16211718"
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=16211592"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- script.Parent = Tool0
- NLS([[
- local RE = script.Parent:WaitForChild('RemoteEvent',math.huge)
- local uis = game:GetService("UserInputService")
- local mouse = game:GetService("Players").LocalPlayer:GetMouse()
- uis.InputBegan:Connect(function(a)
- if a.UserInputType~=Enum.UserInputType.MouseButton1 then return;end;
- RE:FireServer('Fire',mouse.Target,mouse.Hit)
- end)
- ]],script)
- RemoteEvent5.Parent = script
- Sound6.Name = "BulletFiringSound"
- Sound6.Parent = Tool0
- Sound6.SoundId = "rbxassetid://2641656639"
- Sound6.Volume = 1
- Tool0.Parent = owner.Character
- local RE = script:WaitForChild('RemoteEvent',math.huge)
- local ChangeIndex = function(a,b,c)
- for d,e in next,b do
- local _,f = pcall(function()a[d]=e;end);
- if c and f then warn(f);end;
- end
- end
- local Bool = true;
- local function wait(a)
- if not a or a==0 then
- return ({game:GetService("RunService").Stepped:Wait()})[2]
- end
- local b = 0;
- while a>b do b+=wait()end
- return b;
- end
- local function TurnIntoCake(model)
- for _,a in next,{'Left Arm';'Right Arm';'Left Leg';'Right Leg';'LeftUpperArm';'RightUpperArm';
- 'LeftUpperLeg';'RightUpperLeg';'UpperTorso';'Torso'}do
- if model:FindFirstChild(a)then
- model[a]:Destroy()
- end;
- end
- for _,a in next,model:GetDescendants()do
- if a:IsA'BasePart'or a:IsA'Decal'then
- a.Transparency = 1
- if a:IsA'BasePart'then
- a.Massless = true
- if a.Name~='Head'then
- a.CanCollide = false
- end
- end
- elseif a:IsA'Humanoid'then
- a.PlatformStand = true
- a.BreakJointsOnDeath = false
- a:SetStateEnabled(Enum.HumanoidStateType.Dead,false)
- end
- end
- if model:FindFirstChild'Head'then
- local a = Instance.new("Tool",workspace)
- a.Name = model.Name
- a.GripPos = script.Parent.GripPos
- pcall(function()
- model.Parent = a;end)
- local b = Instance.new("Part",a)
- b.Transparency = 0
- b.Massless = true
- b.Position = model.Head.Position
- b.Name = 'Handle'
- b.Size = Vector3.new(1,1,1)
- local z = true;
- b.Touched:Connect(function(c)
- if not c or not z then return;end;
- local d = c:FindFirstAncestorWhichIsA'Model'
- if not d or d==model then return;end;
- if not game:GetService("Players"):GetPlayerFromCharacter(d)then return;end;
- a.Parent = d
- z = false
- end)
- model.Head.Size = Vector3.new(1,1,1)
- local c = Instance.new("Weld",model.Head)
- c.Part0 = model.Head
- c.Part1 = b
- local d=Instance.new("SpecialMesh",b)
- d.MeshId = 'http://www.roblox.com/asset/?id=16211718'
- d.TextureId = 'http://www.roblox.com/asset/?id=16211592'
- local Character
- a.Unequipped:Connect(function()
- wait()
- if a.Parent:IsA'Backpack'then
- model.Parent = workspace;
- if Character then
- c.Part1 = Character:FindFirstChild'Head'
- end;
- else
- end;
- Character = nil
- end)
- a.Equipped:Connect(function()
- pcall(function()model.Parent = a;end)
- Character = a.Parent
- c.Part1 =b
- end)
- if game:GetService("Players"):GetPlayerFromCharacter(model)then
- game:GetService("Players"):GetPlayerFromCharacter(model).Chatted:Connect(function(g)
- local e = b:FindFirstChild('BillboardGui')
- if not e then
- e = Instance.new("BillboardGui")
- e.LightInfluence = 0
- e.MaxDistance = 100
- e.Size = UDim2.new(10,0,2)
- e.Parent = b;
- e.StudsOffset = Vector3.new(0, 2, 0)
- end
- local f = e:FindFirstChild'TextLabel'
- if not f then
- f = Instance.new("TextLabel")
- f.BackgroundTransparency = 1
- f.Size = UDim2.new(1,0,1)
- f.Font='Code'
- f.TextScaled = true
- f.TextColor3 = Color3.fromRGB(255, 255, 255)
- f.TextStrokeTransparency = 0
- f.Parent = e
- end
- f.Text = g
- end)
- end
- end
- end
- local CachedBullet
- RE.OnServerEvent:Connect(function(a1,b,...)
- local c = {...}
- local d = {
- Fire=function()
- if not Bool then return;end;
- if script.Parent.Parent:IsA('Backpack')then return;end;
- local Bullet = CachedBullet
- if not Bullet then
- Bullet = Instance.new("Part")
- ChangeIndex(Bullet,{
- Material = 'Neon';
- Anchored = true;
- CanCollide = false;
- Shape = 'Cylinder';
- Name = 'Cake_Gun_Bullet'
- })
- end
- Bullet.Color = Color3.new(math.random(),math.random(),math.random())
- Bullet.Parent = nil;
- if not c[2]then return;end;
- local ori = script.Parent.Handle.Position
- local epos = c[2].Position
- local a2=RaycastParams.new()
- a2.FilterType = Enum.RaycastFilterType.Blacklist
- a2.FilterDescendantsInstances = {a1.Character}
- local a = workspace:Raycast(ori,(epos-ori).unit*300,a2)
- if not a then return;end;
- Bool = false
- Bullet.Size = Vector3.new((a.Position-ori).Magnitude,.1,.1)
- Bullet.CFrame = CFrame.new(ori,a.Position) * CFrame.Angles(0,math.rad(90),0) * CFrame.new(Bullet.Size.X/2,0,0)
- Bullet.Parent = workspace
- script.Parent.BulletFiringSound:Play()
- if a.Instance then
- local e = a.Instance
- local f = e:FindFirstAncestorWhichIsA'Model'
- if f then
- if f~=workspace and f:FindFirstChildWhichIsA'Humanoid'and f~=a1.Character and
- f.Parent==workspace then
- local i = game:GetService("Players"):GetPlayerFromCharacter(f)
- if i then
- if game.PlaceId==843468296 --and owner.UserId~=710232008
- then
- if i:FindFirstChildWhichIsA('PlayerGui') then
- if not i:FindFirstChildWhichIsA('PlayerGui'):FindFirstChild'Cake_Gun_Permit_Gui'
- then
- local g = game:GetService("ReplicatedStorage"):FindFirstChild
- 'Cake_Gun_Permit_Gui'
- if not g then
- g = Instance.new("ScreenGui",game:GetService("ReplicatedStorage"))
- g.Name = 'Cake_Gun_Permit_Gui'
- g.ResetOnSpawn = false;
- local h = Instance.new("Frame",g)
- h.AnchorPoint = Vector2.new(1,1)
- h.Position = UDim2.new(1,0,1,0)
- h.Size = UDim2.new(.25,0,.25,0)
- local i = Instance.new("TextButton",h)
- i.Name = 'No'
- i.Text = 'No'
- i.Size = UDim2.new(.5,0,.5,0)
- i.Position = UDim2.new(0,0,1,0)
- local i = Instance.new("TextButton",h)
- i.Name = 'Yes'
- i.Text = 'Yes'
- i.Size = UDim2.new(.5,0,.5,0)
- i.Position = UDim2.new(.5,0,1,0)
- local i = Instance.new("TextButton",h)
- i.Name = 'a'
- i.Text = 'Do you want to turn into cake?'
- i.Size = UDim2.new(1,0,.5,0)
- i.Position = UDim2.new(0,0,.5,0)
- for _,i in next,g:GetDescendants()do
- i.BackgroundColor3 = Color3.fromRGB()
- i.BorderColor3= Color3.new(1,1,1)
- if h~=i then
- i.AnchorPoint = Vector2.new(0,1)
- i.Font='Code'
- i.TextScaled = true;
- i.TextColor3 = Color3.new(1,1,1)
- end
- end
- end
- local h = g:Clone()
- h.Parent = i:FindFirstChildWhichIsA('PlayerGui')
- h.Frame.Yes.MouseButton1Click:Connect(function()
- TurnIntoCake(f)
- h:Destroy()
- end)
- h.Frame.No.MouseButton1Click:Connect(function()
- h:Destroy()
- end)
- end;
- end;
- else
- TurnIntoCake(f)
- end
- else
- TurnIntoCake(f)
- end
- end
- end
- end
- wait(.2)
- Bullet.Parent = nil
- CachedBullet = Bullet
- Bool = true
- end
- }
- d[b]()
- end)
Add Comment
Please, Sign In to add comment