Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- char = owner.Character
- NLS([[
- repeat wait()
- until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:waitForChild("SteveVR") and game.Players.LocalPlayer.Character:waitForChild("SteveVR")
- local mouse = game.Players.LocalPlayer:GetMouse()
- repeat wait() until mouse
- local plr = game.Players.LocalPlayer
- local torso = plr.Character.Torso
- local flying = true
- local deb = true
- local ctrl = {f = 0, b = 0, l = 0, r = 0}
- local lastctrl = {f = 0, b = 0, l = 0, r = 0}
- local maxspeed = 200
- local speed = 0
- function Fly()
- local bg = Instance.new("BodyGyro", torso)
- bg.P = 9e4
- bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
- bg.cframe = torso.CFrame
- local bv = Instance.new("BodyVelocity", torso)
- bv.velocity = Vector3.new(0,0.1,0)
- bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
- repeat wait()
- plr.Character:waitForChild("SteveVR").PlatformStand = true
- if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
- speed = speed+.5+(speed/maxspeed)
- if speed > maxspeed then
- speed = maxspeed
- end
- elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
- speed = speed-1
- if speed < 0 then
- speed = 0
- end
- end
- if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
- bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
- lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
- elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
- bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
- else
- bv.velocity = Vector3.new(0,0.1,0)
- end
- bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*0*speed/maxspeed),0,0)
- until not flying
- ctrl = {f = 0, b = 0, l = 0, r = 0}
- lastctrl = {f = 0, b = 0, l = 0, r = 0}
- speed = 0
- bg:Destroy()
- bv:Destroy()
- plr.Character:waitForChild("SteveVR").PlatformStand = false
- end
- mouse.KeyDown:connect(function(key)
- if key:lower() == "e" then
- if flying then flying = false
- else
- flying = true
- Fly()
- end
- elseif key:lower() == "w" then
- ctrl.f = 1
- elseif key:lower() == "s" then
- ctrl.b = -1
- elseif key:lower() == "a" then
- ctrl.l = -1
- elseif key:lower() == "d" then
- ctrl.r = 1
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key:lower() == "w" then
- ctrl.f = 0
- elseif key:lower() == "s" then
- ctrl.b = 0
- elseif key:lower() == "a" then
- ctrl.l = 0
- elseif key:lower() == "d" then
- ctrl.r = 0
- end
- end)
- Fly()
- ]],char)
- -- NOTE (READ!!): This script doesn't work on voidacity's script builder
- -- since it crashes your game, but it's usable on other
- -- script builders like fancy dev's or nexure's.
- -- (it just doesn't work on voidacity only)
- --[[
- ▓▒▒▓▓ ░▓▒▒██▒▒▓█▒▒▓▓ █▒▒▓█▒▒▒▒▒▒▒█▓▒▒▒▒▒▒▒█▒▓▒▒▒▒▒▓█▒▒▒▒▒▒▒█▓▒▒▒▓▒▒▓█▒▒▒▒▒▓▒▓░
- ▓ ░█▒ ▓░ ▓▓ ░█ ░█░▒ ▒▒ █░ █ ░ ▒▓ ▓▒ █ ░░
- ░░ ░ ▒██░░░ █░ ▓▓ ░░█░ ▓▒ ▒█████░ ▓█████░░ ▓▓ ░█ ▒█░█▓ ▒▓ ░███████▓ ██░
- ▓ ▓█▓ ▒▒█ █▒ ░█ ▓▒ ▒█████░ ▓█████░░ ▓▓ ░█ ▒█▓░ ░▓ ▓███████ █▓
- ▓ ░░ ▒█ █▒ ░ █░ ░░░░█░ ▓█████░ ▒██░ ▒██▒ ░█ ░ ░███ ▒░
- ▒░ ░░ ▓▓ █░ ▓▒ █░ ░░ ░█░ ▓█████░ █░ ░░ ░ █░ ░ ███░ ░▒
- ▒░ ▓▓ ▒▓ █░ ▒█ █▒ ░ █ ▓█████░ ▓ █░ ▒▓ █▒ ░ █▒ ▒█▓█████▓ ░▒
- ▒░▒░█▒▒█▓ █░ ▓█ ██░ ░ █░ ▓█████░ ▓█████░ ▒█ ░ █▒ ▒█ ░ █▒ ░███▓███▓░ ▒
- ░▒░ ▒█▓ ▒▒ ▒█░ ▓▓ ░██ ░▓ ▒ ░ █░ █░ ▒█ ▓▒ ░█ ▒▓ ███ ▓███░ ▒░
- ▒░ ░▓██▒░░ ▓▓ █▒ ▒██ ▓▓ ░ ░ ░█░ ░ █░ ▒█ ▓▓ █░ ▒█ █▓░ ░███▒ ░▒
- ▒▒ ▒███░▒ ░█ █▓ ░██░ ▒█ ░ █░ ░ █░ ▒█ █▒ ░█ ▓▓ ░█ ░██▓▒ ▓░
- ▒▒ ▒██▓▓▒ ▒▓ █░ ▓█▓ █░ ▒█░ █░ ▓▓ ░█░ ▓▒ ░█▒ ▓ ▓█▒░ ▒▒
- ▒▒░ █▓ ▓▒░▒█▒░░▓█░░▒█▒▒░░▓▓░▒▒▒░░▒█▒░░░░░░░█▒░▒█▓░░▓█▒░▒█░░░█▓░░▓▒ ▓█░░▒▒
- ░▒▒▒░ ▒░░▒▒░░░░░░░░ ▒░░░▒▒▒▒▒▒▒▒░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒░▒▒▒░░░░ ░░░▒░
- ASCII Art Generators are cool :)
- ]]
- -- Scroll down for changelog...
- -- ORIGINAL CREATOR: Depr1
- -- If this script isn't on pastebin or the user who uploaded this isn't called "Delros12"
- -- (and yes my pastebin account is Delros12) or the link is not https://pastebin.com/2NNDTLjL
- -- then this is not the original link of this script.
- -- The original link of the script gets edited constantly for updates, if you use the original
- -- link you will be able to enjoy the most recent updates of this script without changing to
- -- another link which contains updated script.
- -- Controls: Q to sneak, use the keypad numbers 1-9 to change blocks,
- -- choose a empty slot if you want to remove a block, E to open creative
- -- inventory, right-click to destroy a block in your toolbar in creative
- -- inventory, R to make camera face your character's front or back.
- -- You will become steve when you use this script, if you die after
- -- using this script, keep trying to use it or wait 60 seconds
- -- (it doesn't work at first but eventually it will)
- -- Enjoy! :)
- local updateHand = false
- local RS = game:GetService("RunService").RenderStepped
- local targetName = owner.Name
- local player = game.Players:FindFirstChild(targetName)
- local creativeInventory = {
- {
- name = "Dirt",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152569532",
- backTex = "rbxassetid://152569532",
- topTex = "rbxassetid://152569532",
- bottomTex = "rbxassetid://152569532",
- leftTex = "rbxassetid://152569532",
- rightTex = "rbxassetid://152569532",
- displayTex = "",
- sound = "rbxassetid://1102186681",
- soundVol = 1.25,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Grass",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://96430337",
- backTex = "rbxassetid://96430337",
- topTex = "rbxassetid://96430265",
- bottomTex = "rbxassetid://179655033",
- leftTex = "rbxassetid://96430337",
- rightTex = "rbxassetid://96430337",
- displayTex = "",
- sound = "rbxassetid://1102186681",
- soundVol = 1.25,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Sand",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://347007448",
- backTex = "rbxassetid://347007448",
- topTex = "rbxassetid://347007448",
- bottomTex = "rbxassetid://347007448",
- leftTex = "rbxassetid://347007448",
- rightTex = "rbxassetid://347007448",
- displayTex = "",
- sound = "rbxassetid://1102186681",
- soundVol = 1.25,
- hasGravity = true,
- objectType = "Block"
- },
- {
- name = "Gravel",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151701568",
- backTex = "rbxassetid://151701568",
- topTex = "rbxassetid://151701568",
- bottomTex = "rbxassetid://151701568",
- leftTex = "rbxassetid://151701568",
- rightTex = "rbxassetid://151701568",
- displayTex = "",
- sound = "rbxassetid://1102186681",
- soundVol = 1.25,
- hasGravity = true,
- objectType = "Block"
- },
- {
- name = "Stone",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://75880927",
- backTex = "rbxassetid://75880927",
- topTex = "rbxassetid://75880927",
- bottomTex = "rbxassetid://75880927",
- leftTex = "rbxassetid://75880927",
- rightTex = "rbxassetid://75880927",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Diamond Ore",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152572119",
- backTex = "rbxassetid://152572119",
- topTex = "rbxassetid://152572119",
- bottomTex = "rbxassetid://152572119",
- leftTex = "rbxassetid://152572119",
- rightTex = "rbxassetid://152572119",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Diamond Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://56749955",
- backTex = "rbxassetid://56749955",
- topTex = "rbxassetid://56749955",
- bottomTex = "rbxassetid://56749955",
- leftTex = "rbxassetid://56749955",
- rightTex = "rbxassetid://56749955",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Emerald Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152410853",
- backTex = "rbxassetid://152410853",
- topTex = "rbxassetid://152410853",
- bottomTex = "rbxassetid://152410853",
- leftTex = "rbxassetid://152410853",
- rightTex = "rbxassetid://152410853",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Emerald Ore",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152410868",
- backTex = "rbxassetid://152410868",
- topTex = "rbxassetid://152410868",
- bottomTex = "rbxassetid://152410868",
- leftTex = "rbxassetid://152410868",
- rightTex = "rbxassetid://152410868",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Obsidian",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://112560322",
- backTex = "rbxassetid://112560322",
- topTex = "rbxassetid://112560322",
- bottomTex = "rbxassetid://112560322",
- leftTex = "rbxassetid://112560322",
- rightTex = "rbxassetid://112560322",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Gold Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152572128",
- backTex = "rbxassetid://152572128",
- topTex = "rbxassetid://152572128",
- bottomTex = "rbxassetid://152572128",
- leftTex = "rbxassetid://152572128",
- rightTex = "rbxassetid://152572128",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Gold Ore",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152572121",
- backTex = "rbxassetid://152572121",
- topTex = "rbxassetid://152572121",
- bottomTex = "rbxassetid://152572121",
- leftTex = "rbxassetid://152572121",
- rightTex = "rbxassetid://152572121",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Iron Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152572134",
- backTex = "rbxassetid://152572134",
- topTex = "rbxassetid://152572134",
- bottomTex = "rbxassetid://152572134",
- leftTex = "rbxassetid://152572134",
- rightTex = "rbxassetid://152572134",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Iron Ore",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://132879562",
- backTex = "rbxassetid://132879562",
- topTex = "rbxassetid://132879562",
- bottomTex = "rbxassetid://132879562",
- leftTex = "rbxassetid://132879562",
- rightTex = "rbxassetid://132879562",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Redstone Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://136260219",
- backTex = "rbxassetid://136260219",
- topTex = "rbxassetid://136260219",
- bottomTex = "rbxassetid://136260219",
- leftTex = "rbxassetid://136260219",
- rightTex = "rbxassetid://136260219",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Redstone Ore",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152572209",
- backTex = "rbxassetid://152572209",
- topTex = "rbxassetid://152572209",
- bottomTex = "rbxassetid://152572209",
- leftTex = "rbxassetid://152572209",
- rightTex = "rbxassetid://152572209",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Coal Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152527418",
- backTex = "rbxassetid://152527418",
- topTex = "rbxassetid://152527418",
- bottomTex = "rbxassetid://152527418",
- leftTex = "rbxassetid://152527418",
- rightTex = "rbxassetid://152527418",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Coal Ore",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152572101",
- backTex = "rbxassetid://152572101",
- topTex = "rbxassetid://152572101",
- bottomTex = "rbxassetid://152572101",
- leftTex = "rbxassetid://152572101",
- rightTex = "rbxassetid://152572101",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Bedrock",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://75881126",
- backTex = "rbxassetid://75881126",
- topTex = "rbxassetid://75881126",
- bottomTex = "rbxassetid://75881126",
- leftTex = "rbxassetid://75881126",
- rightTex = "rbxassetid://75881126",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Cobblestone",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152572105",
- backTex = "rbxassetid://152572105",
- topTex = "rbxassetid://152572105",
- bottomTex = "rbxassetid://152572105",
- leftTex = "rbxassetid://152572105",
- rightTex = "rbxassetid://152572105",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Mossy Stone Brick",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://61826751",
- backTex = "rbxassetid://61826751",
- topTex = "rbxassetid://61826751",
- bottomTex = "rbxassetid://61826751",
- leftTex = "rbxassetid://61826751",
- rightTex = "rbxassetid://61826751",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Cracked Stone Brick",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151802087",
- backTex = "rbxassetid://151802087",
- topTex = "rbxassetid://151802087",
- bottomTex = "rbxassetid://151802087",
- leftTex = "rbxassetid://151802087",
- rightTex = "rbxassetid://151802087",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Chiseled Stone Brick",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151802074",
- backTex = "rbxassetid://151802074",
- topTex = "rbxassetid://151802074",
- bottomTex = "rbxassetid://151802074",
- leftTex = "rbxassetid://151802074",
- rightTex = "rbxassetid://151802074",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Stone Brick",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://61826773",
- backTex = "rbxassetid://61826773",
- topTex = "rbxassetid://61826773",
- bottomTex = "rbxassetid://61826773",
- leftTex = "rbxassetid://61826773",
- rightTex = "rbxassetid://61826773",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Nether Brick",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151802104",
- backTex = "rbxassetid://151802104",
- topTex = "rbxassetid://151802104",
- bottomTex = "rbxassetid://151802104",
- leftTex = "rbxassetid://151802104",
- rightTex = "rbxassetid://151802104",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Granite",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151776467",
- backTex = "rbxassetid://151776467",
- topTex = "rbxassetid://151776467",
- bottomTex = "rbxassetid://151776467",
- leftTex = "rbxassetid://151776467",
- rightTex = "rbxassetid://151776467",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Diorite",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151776452",
- backTex = "rbxassetid://151776452",
- topTex = "rbxassetid://151776452",
- bottomTex = "rbxassetid://151776452",
- leftTex = "rbxassetid://151776452",
- rightTex = "rbxassetid://151776452",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Andesite",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151776422",
- backTex = "rbxassetid://151776422",
- topTex = "rbxassetid://151776422",
- bottomTex = "rbxassetid://151776422",
- leftTex = "rbxassetid://151776422",
- rightTex = "rbxassetid://151776422",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Polished Granite",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151776506",
- backTex = "rbxassetid://151776506",
- topTex = "rbxassetid://151776506",
- bottomTex = "rbxassetid://151776506",
- leftTex = "rbxassetid://151776506",
- rightTex = "rbxassetid://151776506",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Polished Diorite",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151776533",
- backTex = "rbxassetid://151776533",
- topTex = "rbxassetid://151776533",
- bottomTex = "rbxassetid://151776533",
- leftTex = "rbxassetid://151776533",
- rightTex = "rbxassetid://151776533",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Polished Andesite",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151776506",
- backTex = "rbxassetid://151776506",
- topTex = "rbxassetid://151776506",
- bottomTex = "rbxassetid://151776506",
- leftTex = "rbxassetid://151776506",
- rightTex = "rbxassetid://151776506",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Brick Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://59389191",
- backTex = "rbxassetid://59389191",
- topTex = "rbxassetid://59389191",
- bottomTex = "rbxassetid://59389191",
- leftTex = "rbxassetid://59389191",
- rightTex = "rbxassetid://59389191",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Packed Ice",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152528023",
- backTex = "rbxassetid://152528023",
- topTex = "rbxassetid://152528023",
- bottomTex = "rbxassetid://152528023",
- leftTex = "rbxassetid://152528023",
- rightTex = "rbxassetid://152528023",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Ice Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 1;
- frontTex = "rbxassetid://118555586",
- backTex = "rbxassetid://118555586",
- topTex = "rbxassetid://118555586",
- bottomTex = "rbxassetid://118555586",
- leftTex = "rbxassetid://118555586",
- rightTex = "rbxassetid://118555586",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Netherrack",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151802119",
- backTex = "rbxassetid://151802119",
- topTex = "rbxassetid://151802119",
- bottomTex = "rbxassetid://151802119",
- leftTex = "rbxassetid://151802119",
- rightTex = "rbxassetid://151802119",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "End Stone",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://151802091",
- backTex = "rbxassetid://151802091",
- topTex = "rbxassetid://151802091",
- bottomTex = "rbxassetid://151802091",
- leftTex = "rbxassetid://151802091",
- rightTex = "rbxassetid://151802091",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Glass Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 1;
- frontTex = "rbxassetid://152239003",
- backTex = "rbxassetid://152239003",
- topTex = "rbxassetid://152239003",
- bottomTex = "rbxassetid://152239003",
- leftTex = "rbxassetid://152239003",
- rightTex = "rbxassetid://152239003",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Glowstone",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://54790811",
- backTex = "rbxassetid://54790811",
- topTex = "rbxassetid://54790811",
- bottomTex = "rbxassetid://54790811",
- leftTex = "rbxassetid://54790811",
- rightTex = "rbxassetid://54790811",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Bookshelf",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://118554092",
- backTex = "rbxassetid://118554092",
- topTex = "rbxassetid://346201871",
- bottomTex = "rbxassetid://346201871",
- leftTex = "rbxassetid://118554092",
- rightTex = "rbxassetid://118554092",
- displayTex = "",
- sound = "rbxassetid://507863457",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Oak Wood Planks",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://346201871",
- backTex = "rbxassetid://346201871",
- topTex = "rbxassetid://346201871",
- bottomTex = "rbxassetid://346201871",
- leftTex = "rbxassetid://346201871",
- rightTex = "rbxassetid://346201871",
- displayTex = "",
- sound = "rbxassetid://507863457",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Oak Log",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://71445924",
- backTex = "rbxassetid://71445924",
- topTex = "rbxassetid://152538557",
- bottomTex = "rbxassetid://152538557",
- leftTex = "rbxassetid://71445924",
- rightTex = "rbxassetid://71445924",
- displayTex = "",
- sound = "rbxassetid://507863457",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Oak Leaves",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 1;
- frontTex = "rbxassetid://151708391",
- backTex = "rbxassetid://151708391",
- topTex = "rbxassetid://151708391",
- bottomTex = "rbxassetid://151708391",
- leftTex = "rbxassetid://151708391",
- rightTex = "rbxassetid://151708391",
- displayTex = "",
- sound = "rbxassetid://507863457",
- -- couldn't find a leaves sound for this one, sorry lol
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- }
- }
- local toolBar = {
- {
- name = "Dirt Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://152569532",
- backTex = "rbxassetid://152569532",
- topTex = "rbxassetid://152569532",
- bottomTex = "rbxassetid://152569532",
- leftTex = "rbxassetid://152569532",
- rightTex = "rbxassetid://152569532",
- displayTex = "",
- sound = "rbxassetid://1102186681",
- soundVol = 1.25,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Grass Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://96430337",
- backTex = "rbxassetid://96430337",
- topTex = "rbxassetid://96430265",
- bottomTex = "rbxassetid://179655033",
- leftTex = "rbxassetid://96430337",
- rightTex = "rbxassetid://96430337",
- displayTex = "",
- sound = "rbxassetid://1102186681",
- soundVol = 1.25,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Stone",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://75880927",
- backTex = "rbxassetid://75880927",
- topTex = "rbxassetid://75880927",
- bottomTex = "rbxassetid://75880927",
- leftTex = "rbxassetid://75880927",
- rightTex = "rbxassetid://75880927",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Diamond Ore",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://57928490",
- backTex = "rbxassetid://57928490",
- topTex = "rbxassetid://57928490",
- bottomTex = "rbxassetid://57928490",
- leftTex = "rbxassetid://57928490",
- rightTex = "rbxassetid://57928490",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Diamond Block",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://56749955",
- backTex = "rbxassetid://56749955",
- topTex = "rbxassetid://56749955",
- bottomTex = "rbxassetid://56749955",
- leftTex = "rbxassetid://56749955",
- rightTex = "rbxassetid://56749955",
- displayTex = "",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Oak Wood Planks",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://346201871",
- backTex = "rbxassetid://346201871",
- topTex = "rbxassetid://346201871",
- bottomTex = "rbxassetid://346201871",
- leftTex = "rbxassetid://346201871",
- rightTex = "rbxassetid://346201871",
- displayTex = "",
- sound = "rbxassetid://507863457",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- },
- {
- name = "Oak Log",
- size = Vector3.new(2.6, 2.6, 2.6),
- transparency = 0;
- frontTex = "rbxassetid://71445924",
- backTex = "rbxassetid://71445924",
- topTex = "rbxassetid://152538557",
- bottomTex = "rbxassetid://152538557",
- leftTex = "rbxassetid://71445924",
- rightTex = "rbxassetid://71445924",
- displayTex = "",
- sound = "rbxassetid://507863457",
- soundVol = 2,
- hasGravity = false,
- objectType = "Block"
- }
- --[[{
- name = "Redstone",
- size = Vector3.new(2.6, 0.05, 2.6),
- transparency = 1;
- frontTex = "rbxassetid://151911305",
- backTex = "",
- topTex = "rbxassetid://151911305",
- bottomTex = "",
- leftTex = "",
- rightTex = "",
- displayTex = "rbxassetid://64124418",
- sound = "rbxassetid://1016978163",
- soundVol = 2,
- hasGravity = false,
- objectType = "Redstone Dust"
- },]]
- }
- function putTexture(part, frontF, backF, topF, bottomF, leftF, rightF, className)
- local faces = {"Front", "Back", "Top", "Bottom", "Left", "Right"}
- for i,f in pairs(faces) do
- local decal = Instance.new(className, part)
- if i == 1 then decal.Texture = frontF decal.Name = f end
- if i == 2 then decal.Texture = backF or frontF decal.Name = f end
- if i == 3 then decal.Texture = topF or frontF decal.Name = f end
- if i == 4 then decal.Texture = bottomF or frontF decal.Name = f end
- if i == 5 then decal.Texture = leftF or frontF decal.Name = f end
- if i == 6 then decal.Texture = rightF or frontF decal.Name = f end
- decal.Face = f
- end
- return part
- end
- function makeSquare(position, size, color, transparency, parent, zindex)
- local label = Instance.new("TextLabel", parent)
- label.Text = ""
- label.BorderSizePixel = 0
- label.BackgroundTransparency = transparency
- label.Position = position
- label.Size = size
- label.BackgroundColor3 = color
- if zindex == nil then label.ZIndex = 1 else label.ZIndex = zindex end
- return label
- end
- function makeImage(position, size, image, parent, zindex)
- local imglabel = Instance.new("ImageLabel", parent)
- imglabel.BorderSizePixel = 0
- imglabel.BackgroundTransparency = 1
- imglabel.Position = position
- imglabel.Size = size
- imglabel.Image = image
- if zindex == nil then imglabel.ZIndex = 1 else imglabel.ZIndex = zindex end
- return imglabel
- end
- function putInventorySlot(position, image, parent, zindex)
- local button = Instance.new("TextButton", parent)
- button.Position = position
- button.Size = UDim2.new(0, 36, 0, 36)
- button.BackgroundColor3 = Color3.new(139/255, 139/255, 139/255)
- button.Text = ""
- button.BorderSizePixel = 0
- button.ZIndex = zindex
- local imageLabel = Instance.new("ImageLabel", button)
- imageLabel.BackgroundTransparency = 0.9
- imageLabel.Position = UDim2.new(0, 2, 0, 2)
- imageLabel.Size = UDim2.new(0, 32, 0, 32)
- imageLabel.Image = image
- imageLabel.BorderSizePixel = 0
- imageLabel.ZIndex = zindex
- makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 34, 0, 2),
- Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
- makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 34),
- Color3.new(55/255, 55/255, 55/255), 0, button, zindex)
- makeSquare(UDim2.new(0, 34, 0, 2), UDim2.new(0, 2, 0, 34),
- Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
- makeSquare(UDim2.new(0, 2, 0, 34), UDim2.new(0, 34, 0, 2),
- Color3.new(255/255, 255/255, 255/255), 0, button, zindex)
- return button
- end
- function AngleDifference(Angle1, Angle2)
- local Difference = {X = 0, Y = 0, Z = 0}
- Difference.X = Angle2.X - Angle1.X
- if (Difference.X > 180) then
- Difference.X = Difference.X - 360
- elseif (Difference.X < -180) then
- Difference.X = Difference.X + 360
- end
- Difference.Y = Angle2.Y - Angle1.Y
- if (Difference.Y > 180) then
- Difference.Y = Difference.Y - 360
- elseif (Difference.Y < -180) then
- Difference.Y = Difference.Y + 360
- end
- Difference.Z = Angle2.Z - Angle1.Z
- if (Difference.Z > 180) then
- Difference.Z = Difference.Z - 360
- elseif (Difference.Z < -180) then
- Difference.Z = Difference.Z + 360
- end
- return Vector3.new(Difference.X, Difference.Y, Difference.Z)
- end
- local draggingBlock = nil
- function makeInventory()
- local playerGui = player:FindFirstChild("PlayerGui")
- if playerGui then
- local invGui = Instance.new("ScreenGui", playerGui)
- local creativeInv = Instance.new("Frame", invGui)
- creativeInv.BackgroundTransparency = 1
- creativeInv.Position = UDim2.new(0.5, -170, 0.5, -202)
- creativeInv.Visible = false
- -- creative inventory GUI...
- local blackOut = makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(1, 0, 1, 0),
- Color3.new(0/255, 0/255, 0/255), 0.3, invGui, 1)
- blackOut.Visible = false
- creativeInv.Changed:connect(function()
- blackOut.Visible = creativeInv.Visible
- end)
- makeSquare(UDim2.new(0, -2, 0, 2), UDim2.new(0, 340, 0, 404),
- Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
- makeSquare(UDim2.new(0, 338, 0, 0), UDim2.new(0, 6, 0, 406),
- Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 2)
- makeSquare(UDim2.new(0, 0, 0, 404), UDim2.new(0, 342, 0, 4),
- Color3.new(85/255, 85/255, 85/255), 0, creativeInv, 3)
- makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 338, 0, 402),
- Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 3)
- makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 4, 0, 406),
- Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 3)
- makeSquare(UDim2.new(0, -2, 0, -4), UDim2.new(0, 342, 0, 6),
- Color3.new(255/255, 255/255, 255/255), 0, creativeInv, 2)
- makeSquare(UDim2.new(0, 340, 0, -2), UDim2.new(0, 2, 0, 2),
- Color3.new(198/255, 198/255, 198/255), 0, creativeInv, 2)
- makeSquare(UDim2.new(0, 340, 0, -4), UDim2.new(0, 2, 0, 4),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- makeSquare(UDim2.new(0, 342, 0, -2), UDim2.new(0, 2, 0, 2),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- makeSquare(UDim2.new(0, 344, 0, 0), UDim2.new(0, 2, 0, 406),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 2, 0, 4),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- makeSquare(UDim2.new(0, -2, 0, -6), UDim2.new(0, 342, 0, 4),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- makeSquare(UDim2.new(0, 0, 0, 406), UDim2.new(0, 342, 0, 4),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- makeSquare(UDim2.new(0, 342, 0, 404), UDim2.new(0, 2, 0, 4),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- makeSquare(UDim2.new(0, -4, 0, 404), UDim2.new(0, 2, 0, 2),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- makeSquare(UDim2.new(0, -2, 0, 406), UDim2.new(0, 2, 0, 2),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- makeSquare(UDim2.new(0, -6, 0, -2), UDim2.new(0, 2, 0, 406),
- Color3.new(0/255, 0/255, 0/255), 0, creativeInv, 1)
- local text = makeSquare(UDim2.new(0, 4, 0, 8), UDim2.new(0, 0, 0, 0), Color3.new(0/255, 0/255, 0/255), 1, creativeInv, 3)
- text.Text = "Creative Inventory"
- text.Font = "SourceSansSemibold"
- text.TextSize = 14
- text.TextXAlignment = "Left"
- --
- local draggingBlockPicture = Instance.new("ImageLabel", invGui)
- draggingBlockPicture.BackgroundTransparency = 1
- draggingBlockPicture.Size = UDim2.new(0, 32, 0, 32)
- draggingBlockPicture.ZIndex = 5
- coroutine.resume(coroutine.create(function()
- local invMouse = player:GetMouse()
- --local RS = game:GetService("RunService").RenderStepped
- invMouse.Button2Down:connect(function()
- draggingBlock = nil
- end)
- while RS:wait() do
- draggingBlockPicture.Position = UDim2.new(0, invMouse.X - 16, 0, invMouse.Y - 16)
- if draggingBlock ~= nil then
- draggingBlockPicture.Image = draggingBlock.frontTex
- else
- draggingBlockPicture.Image = ""
- end
- end
- end))
- local done = false
- local x = 0
- local y = 0
- for i,b in pairs(creativeInventory) do
- local display = ""
- if b.displayTex == "" then
- display = b.frontTex
- else
- if b.displayTex then
- display = b.displayTex
- end
- end
- putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), display, creativeInv, 4).MouseButton1Down:connect(function()
- if draggingBlock == nil then
- draggingBlock = b
- end
- end)
- x = x + 1
- if x >= 8 then
- x = 0
- y = y + 1
- end
- end
- if x == 0 then done = true end
- while x < 8 and done == false do
- putInventorySlot(UDim2.new(0.5, (x*36) + 8, 0.5, (y*36) + 28), "", creativeInv, 4)
- x = x + 1
- end
- for i = 1, 9 do
- if toolBar[i] ~= nil then
- local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), toolBar[i].frontTex, creativeInv, 4)
- invSlot.MouseButton2Down:connect(function()
- local imgLabel = invSlot:FindFirstChild("ImageLabel")
- if imgLabel then
- toolBar[i] = nil
- imgLabel.Image = ""
- end
- end)
- invSlot.MouseButton1Down:connect(function()
- --updateHand = true
- local imgLabel = invSlot:FindFirstChild("ImageLabel")
- if toolBar[i] == nil then
- toolBar[i] = draggingBlock
- imgLabel.Image = draggingBlock.frontTex
- draggingBlock = nil
- return
- end
- if toolBar[i] ~= nil and draggingBlock == nil then
- draggingBlock = toolBar[i]
- toolBar[i] = nil
- imgLabel.Image = ""
- return
- elseif toolBar[i] ~= nil and draggingBlock ~= nil then
- --draggingBlock = toolBar[i]
- --toolBar[i] = nil
- imgLabel.Image = ""
- local temp = toolBar[i]
- toolBar[i] = draggingBlock
- if imgLabel and draggingBlock ~= nil then
- imgLabel.Image = draggingBlock.frontTex
- end
- if imgLabel and draggingBlock == nil then
- imgLabel.Image = ""
- end
- draggingBlock = temp
- return
- end
- end)
- else
- local invSlot = putInventorySlot(UDim2.new(0, 8 + ((i-1)*36), 0, 360), "", creativeInv, 4)
- invSlot.MouseButton2Down:connect(function()
- local imgLabel = invSlot:FindFirstChild("ImageLabel")
- if imgLabel then
- toolBar[i] = nil
- imgLabel.Image = ""
- end
- end)
- invSlot.MouseButton1Down:connect(function()
- --updateHand = true
- local imgLabel = invSlot:FindFirstChild("ImageLabel")
- if toolBar[i] == nil then
- toolBar[i] = draggingBlock
- imgLabel.Image = draggingBlock.frontTex
- draggingBlock = nil
- return
- end
- if toolBar[i] ~= nil and draggingBlock == nil then
- draggingBlock = toolBar[i]
- toolBar[i] = nil
- imgLabel.Image = ""
- return
- elseif toolBar[i] ~= nil and draggingBlock ~= nil then
- --draggingBlock = toolBar[i]
- --toolBar[i] = nil
- imgLabel.Image = ""
- local temp = toolBar[i]
- toolBar[i] = draggingBlock
- if imgLabel and draggingBlock ~= nil then
- imgLabel.Image = draggingBlock.frontTex
- end
- if imgLabel and draggingBlock == nil then
- imgLabel.Image = ""
- end
- draggingBlock = temp
- return
- end
- end)
- end
- end
- return creativeInv
- end
- end
- function putToolBarSlot(position, image, zindex)
- local playerGui = player:FindFirstChild("PlayerGui")
- if playerGui then
- local gui = playerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", playerGui)
- gui.Name = "ToolBar"
- local slot = Instance.new("ImageLabel", gui)
- slot.Position = position
- slot.Size = UDim2.new(0, 32, 0, 32)
- slot.BackgroundTransparency = 1
- slot.ImageTransparency = 0
- slot.Image = image
- slot.ZIndex = 2
- local imgSlot = makeImage(UDim2.new(0, 0, 0, 0), UDim2.new(0, 32, 0, 32),
- "rbxassetid://347007448", slot)
- imgSlot.ImageTransparency = 0.25
- imgSlot.BackgroundTransparency = 1
- imgSlot.ImageColor3 = Color3.new(0.225, 0.225, 0.225)
- makeSquare(UDim2.new(0, 0, 0, 0), UDim2.new(0, 2, 0, 32),
- Color3.new(0/255, 0/255, 0/255), 0.7, slot)
- makeSquare(UDim2.new(0, 2, 0, 0), UDim2.new(0, 30, 0, 2),
- Color3.new(0/255, 0/255, 0/255), 0.7, slot)
- makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 36, 0, 2),
- Color3.new(106/255, 106/255, 106/255), 0, slot)
- makeSquare(UDim2.new(0, -2, 0, -2), UDim2.new(0, 2, 0, 36),
- Color3.new(106/255, 106/255, 106/255), 0, slot)
- makeSquare(UDim2.new(0, 0, 0, 32), UDim2.new(0, 34, 0, 2),
- Color3.new(130/255, 130/255, 130/255), 0, slot)
- makeSquare(UDim2.new(0, 32, 0, 0), UDim2.new(0, 2, 0, 34),
- Color3.new(130/255, 130/255, 130/255), 0, slot)
- makeSquare(UDim2.new(0, -4, 0, -2), UDim2.new(0, 2, 0, 38),
- Color3.new(130/255, 130/255, 130/255), 0, slot)
- makeSquare(UDim2.new(0, 34, 0, -2), UDim2.new(0, 2, 0, 36),
- Color3.new(106/255, 106/255, 106/255), 0, slot)
- makeSquare(UDim2.new(0, -2, 0, 34), UDim2.new(0, 38, 0, 2),
- Color3.new(106/255, 106/255, 106/255), 0, slot)
- makeSquare(UDim2.new(0, -4, 0, -4), UDim2.new(0, 40, 0, 2),
- Color3.new(156/255, 156/255, 156/255), 0, slot)
- return slot
- end
- end
- function divide(x, d)
- if x ~= 0 and d ~= 0 then
- return x/d
- else
- return x
- end
- end -- so it doesn't divide by zero
- function getDistance(v1, v2)
- return math.abs((Vector3.new(math.abs(v2.X - v1.X), math.abs(v2.Y - v1.Y), math.abs(v2.Z - v1.Z))).Magnitude)
- end
- function SnapToGrid(x, gridX)
- local x = math.floor((x / gridX) + 0.5) * gridX
- return x
- end
- function round(x)
- if x%2 ~= 0.5 then
- return math.floor(x+0.5)
- end
- return x-0.5
- end
- function weldTo(part1, part2)
- local weld = Instance.new("Weld", part1)
- weld.Part0 = part1
- weld.Part1 = part2
- return weld
- end
- function getMagnitudeXZ(velocity)
- return math.sqrt(math.abs(velocity.X)^2 + math.abs(velocity.Z)^2)
- end
- function findHumanoid(inst)
- local find = inst
- local hum = nil
- repeat
- if find.Name == "Workspace" then return nil end
- find = find.Parent
- hum = find:FindFirstChild("Humanoid")
- until hum
- --if hum then print("found!!") else print("aw... not found") end
- --if hum.ClassName ~= "Humanoid" then hum = nil end
- return hum
- end
- function getSideByLocation(loc)
- local side = nil
- if loc.X < 0 then side = "Left" end
- if loc.X > 0 then side = "Right" end
- if loc.Y > 0 then side = "Top" end
- if loc.Y < 0 then side = "Bottom" end
- if loc.Z < 0 then side = "Front" end
- if loc.Z > 0 then side = "Back" end
- if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
- (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
- (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
- then
- return nil
- end
- return side
- end
- function getSideByLocationRedstone(loc)
- local side = nil
- if loc.X < 0 then side = "Left" end
- if loc.X > 0 then side = "Right" end
- if loc.Y > 0 then side = "Top" end
- if loc.Y < 0 then side = "Bottom" end
- if loc.Z < 0 then side = "Front" end
- if loc.Z > 0 then side = "Back" end
- if (math.abs(loc.X) > 0 and math.abs(loc.Y) > 0) or
- (math.abs(loc.X) > 0 and math.abs(loc.Z) > 0) or
- (math.abs(loc.Y) > 0 and math.abs(loc.Z) > 0)
- then
- return nil
- end
- return side
- end
- function getBlockAtRegion(region)
- local blockFound = nil
- for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
- local usePart = true
- if part.Name == "Debris" then usePart = false end
- if usePart == true then
- blockFound = part
- break
- end
- end
- return blockFound
- end
- function getRedstoneAtRegion(region)
- local blockFound = nil
- for _,part in pairs(game.Workspace:FindPartsInRegion3(region, nil, math.huge)) do
- if isRedstone(part) then
- blockFound = part
- break
- end
- end
- return blockFound
- end
- function isRedstone(block)
- local objType = block:FindFirstChild("ObjectType")
- if objType then
- if objType.Value == "Redstone Dust" then
- return true
- else
- return false
- end
- end
- end
- function updateRedstoneDust(dust, leftBlk, rightBlk, topBlk, bottomBlk, frontBlk, backBlk, recursion)
- local objType = nil
- if dust then
- objType = dust:FindFirstChild("ObjectType")
- end
- local redstoneDust = "rbxassetid://151911305"
- local redstoneLine = "rbxassetid://151907047"
- local redstoneCorner = "rbxassetid://151907106"
- local redstoneT = "rbxassetid://151907156"
- local redstoneCross = "rbxassetid://151906997"
- local Rotation = 0
- local theresRedstoneAtLeft = false
- local theresRedstoneAtRight = false
- local theresRedstoneAtFront = false
- local theresRedstoneAtBack = false
- if leftBlk then theresRedstoneAtLeft = isRedstone(leftBlk) end
- if rightBlk then theresRedstoneAtRight = isRedstone(rightBlk) end
- if frontBlk then theresRedstoneAtFront = isRedstone(frontBlk) end
- if backBlk then theresRedstoneAtBack = isRedstone(backBlk) end
- if objType then
- if objType.Value == "Redstone Dust" then
- local topDecal = dust:FindFirstChild("Top")
- if topDecal then
- if theresRedstoneAtBack == false and theresRedstoneAtFront == false and
- theresRedstoneAtLeft == false and theresRedstoneAtRight == false then
- topDecal.Texture = redstoneDust
- Rotation = 0
- end
- if theresRedstoneAtLeft == true or theresRedstoneAtRight == true then
- topDecal.Texture = redstoneLine
- Rotation = 0
- end
- if theresRedstoneAtFront == true or theresRedstoneAtBack == true then
- topDecal.Texture = redstoneLine
- Rotation = 90
- end
- if theresRedstoneAtLeft == true and theresRedstoneAtBack == true then
- topDecal.Texture = redstoneCorner
- Rotation = 0
- end
- if theresRedstoneAtBack == true and theresRedstoneAtRight == true then
- topDecal.Texture = redstoneCorner
- Rotation = 90
- end
- if theresRedstoneAtRight == true and theresRedstoneAtFront == true then
- topDecal.Texture = redstoneCorner
- Rotation = 180
- end
- if theresRedstoneAtFront == true and theresRedstoneAtLeft == true then
- topDecal.Texture = redstoneCorner
- Rotation = -90
- end
- if theresRedstoneAtBack == true and theresRedstoneAtLeft == true
- and theresRedstoneAtFront == true then
- topDecal.Texture = redstoneT
- Rotation = -90
- end
- if theresRedstoneAtLeft == true and theresRedstoneAtFront == true
- and theresRedstoneAtRight == true then
- topDecal.Texture = redstoneT
- Rotation = -180
- end
- if theresRedstoneAtFront == true and theresRedstoneAtRight == true
- and theresRedstoneAtBack == true then
- topDecal.Texture = redstoneT
- Rotation = 90
- end
- if theresRedstoneAtRight == true and theresRedstoneAtBack == true
- and theresRedstoneAtLeft == true then
- topDecal.Texture = redstoneT
- Rotation = 0
- end
- if theresRedstoneAtLeft == true and theresRedstoneAtRight == true and
- theresRedstoneAtFront == true and theresRedstoneAtBack == true then
- topDecal.Texture = redstoneCross
- Rotation = 0
- end
- end
- else
- error("Not redstone dust.")
- end
- end
- if recursion == true then
- local function updateTex(blockTarget)
- local leftSide = nil
- local rightSide = nil
- local frontSide = nil
- local backSide = nil
- local Point1 = blockTarget.CFrame.p - Vector3.new(2.6, 0.1, 2.6)
- local Point2 = blockTarget.CFrame.p + Vector3.new(2.6, 0.1, 2.6)
- local Region = Region3.new(Point1, Point2)
- for _,part in pairs(game.Workspace:FindPartsInRegion3(
- Region,
- nil,
- math.huge
- )) do
- local objType = part:FindFirstChild("ObjectType")
- if isRedstone(part) then
- local side = getSideByLocationRedstone(blockTarget.CFrame.p - part.CFrame.p)
- if side == "Left" then
- leftSide = part
- elseif side == "Right" then
- rightSide = part
- elseif side == "Front" then
- frontSide = part
- elseif side == "Back" then
- backSide = part
- elseif side == "Left Top" then
- leftSide = part
- elseif side == "Right Top" then
- rightSide = part
- elseif side == "Front Top" then
- frontSide = part
- elseif side == "Back Top" then
- backSide = part
- elseif side == "Left Bottom" then
- leftSide = part
- elseif side == "Right Bottom" then
- rightSide = part
- elseif side == "Front Bottom" then
- frontSide = part
- elseif side == "Back Bottom" then
- backSide = part
- end
- end
- end
- updateRedstoneDust(blockTarget, leftSide, rightSide, nil, nil, frontSide, backSide, false)
- end
- if leftBlk and theresRedstoneAtLeft then updateTex(leftBlk) end
- if rightBlk and theresRedstoneAtRight then updateTex(rightBlk) end
- if frontBlk and theresRedstoneAtFront then updateTex(frontBlk) end
- if backBlk and theresRedstoneAtBack then updateTex(backBlk) end
- end
- if dust then dust.CFrame = CFrame.new(dust.CFrame.p.X, dust.CFrame.p.Y, dust.CFrame.p.Z) * CFrame.Angles(0, math.rad(Rotation), 0) end
- end
- if player then
- local char = player.Character
- if char then
- char:FindFirstChildOfClass("Humanoid").DisplayDistanceType = "None"
- if char then
- local d = char:GetChildren()
- for i=1, #d do
- if (d[i].className == "Accessory") then
- d[i]:remove()
- end
- if (d[i].className == "Hat") then
- d[i]:remove()
- end
- end
- end
- damage = 10
- local diedtofalldamage = false
- local damageHeight = 10.4 -- The height at which the player will start getting damaged at
- local lethalHeight = 59.8 -- The height at which the player will get killed
- local root = char:WaitForChild("HumanoidRootPart")
- local humanoid = char:WaitForChild("Humanoid")
- humanoid.Name = "SteveVR"
- humanoid.MaxHealth = math.huge
- humanoid.Health = 9e9
- Gravity = -2
- humanoid.JumpPower = 25.11
- BodyForce = Instance.new("BodyForce")
- BodyForce.force = Vector3.new(0, (1-Gravity) * root:GetMass() * 236 / 1.2, 0)
- BodyForce:clone().Parent = root
- if humanoid and root then
- local headHeight
- humanoid.FreeFalling:Connect(function (state)
- if state then
- headHeight = root.Position.Y
- elseif not state and headHeight ~= nil then
- pcall(function ()
- local fell = headHeight - root.Position.Y
- if fell >= lethalHeight then
- humanoid.Health = 0
- diedtofalldamage = true
- wait()
- for i,v in pairs(game.Players:GetChildren()) do
- if v.PlayerGui:FindFirstChild("TextLabel").Text == player.Name.. "Died" then
- --v:FindFirstChild("TextLabel").Text = player.Name.. "fell from a high place"
- end
- end
- elseif fell >= damageHeight then
- humanoid.Health = humanoid.Health - math.floor(fell)
- end
- end)
- end
- end)
- end
- for _,cM in pairs(char:GetChildren()) do
- if cM.ClassName == "CharacterMesh" then cM:Destroy() end
- end
- --[]
- local gui = player.PlayerGui:FindFirstChild("ToolBar") or Instance.new("ScreenGui", player.PlayerGui)
- gui.Name = "ToolBar"
- makeSquare(UDim2.new(0.5, -166, 1, -111), UDim2.new(0, 364, 0, 2),
- Color3.new(0/255, 0/255, 0/255), 0, gui)
- makeSquare(UDim2.new(0.5, -166, 1, -111 + 42), UDim2.new(0, 364, 0, 2),
- Color3.new(0/255, 0/255, 0/255), 0, gui)
- makeSquare(UDim2.new(0.5, -166, 1, -111), UDim2.new(0, 2, 0, 44),
- Color3.new(0/255, 0/255, 0/255), 0, gui)
- makeSquare(UDim2.new(0.5, -166 + 362, 1, -111), UDim2.new(0, 2, 0, 44),
- Color3.new(0/255, 0/255, 0/255), 0, gui)
- for i = 1, 9 do
- if toolBar[i] ~= nil then
- local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), toolBar[i].frontTex)
- coroutine.resume(coroutine.create(function()
- while wait() do
- if toolBar[i] ~= nil then
- if toolBar[i].displayTex == "" then
- img.Image = toolBar[i].frontTex
- else
- img.Image = toolBar[i].displayTex
- end
- else
- img.Image = ""
- end
- end
- end))
- else
- local img = putToolBarSlot(UDim2.new(0.5, -160 + ((i-1)*40), 1, -105), "")
- coroutine.resume(coroutine.create(function()
- while wait() do
- if toolBar[i] ~= nil then
- if toolBar[i].displayTex == "" then
- img.Image = toolBar[i].frontTex
- else
- img.Image = toolBar[i].displayTex
- end
- else
- img.Image = ""
- end
- end
- end))
- end
- end
- local creativeInventoryGUI = makeInventory()
- local humRootPart = char:WaitForChild("HumanoidRootPart")
- local head = char:WaitForChild("Head")
- head.Touched:Connect(function(p)
- if p.Name ~= "Baseplate" then
- p.Anchored = false
- p:BreakJoints()
- p.Velocity = Vector3.new(p.Velocity.X + (head.CFrame.lookVector.X * 200), p.Velocity.Y + (head.CFrame.lookVector.Y * 200) + 20, p.Velocity.Z + (head.CFrame.lookVector.Z * 20))
- end
- end)
- local torso = char:WaitForChild("Torso")
- torso.Size = Vector3.new(1.3 * 20, 1.95 * 20, 0.65 * 20)
- local lArm = char:WaitForChild("Left Arm")
- local rArm = char:WaitForChild("Right Arm")
- local rArmPuller = Instance.new("Part",char)
- local rArmPullerWeld = Instance.new("Weld",char)
- local dragged = nil
- rArmPuller.Transparency = 1
- rArmPuller.Size = Vector3.new(1,12,1)
- rArmPuller.Anchored = false
- rArmPuller.CanCollide = false
- rArmPullerWeld.Part0 = rArm
- rArmPullerWeld.Part1 = rArmPuller
- rArmPullerWeld.C0 = CFrame.new(0,-1.95 * 0.332 * 20 - 1,0)
- rArmPuller.Touched:Connect(function(part)
- if dragged ~= nil and part == dragged then
- weldTo(rArmPuller,dragged)
- rArm.Anchored = false
- head.Anchored = false
- end
- end)
- local lLeg = char:WaitForChild("Left Leg")
- local rLeg = char:WaitForChild("Right Leg")
- lLeg.Transparency = 1
- rLeg.Transparency = 1
- torso.Transparency = 1
- blockmesharm = Instance.new("BlockMesh", lArm)
- blockmesharm.Offset = Vector3.new(0,0.332 * 20,0)
- blockmesharm2 = Instance.new("BlockMesh", rArm)
- blockmesharm2.Offset = Vector3.new(0,0.332 * 20,0)
- head.Size = Vector3.new(1.3, 1.3, 1.3) * 20
- putTexture(head, "rbxassetid://38738031", "rbxassetid://36047330",
- "rbxassetid://36047341", "rbxassetid://36047347",
- "rbxassetid://36047323", "rbxassetid://36047315", "Decal")
- lArm.Size = Vector3.new(0.65, 1.95, 0.65) * 20
- putTexture(lArm, "rbxassetid://38934581", "rbxassetid://38934560",
- "rbxassetid://38934613", "rbxassetid://38934568",
- "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
- rArm.Size = Vector3.new(0.65, 1.95, 0.65) * 20
- putTexture(rArm, "rbxassetid://38934560", "rbxassetid://38934581",
- "rbxassetid://38934613", "rbxassetid://38934568",
- "rbxassetid://38934601", "rbxassetid://38934591", "Decal")
- head:WaitForChild("Mesh"):Destroy()
- head:WaitForChild("face"):Destroy()
- lS = Instance.new("Motor6D",torso)
- lS.Name = "Left Shoulder"
- lS.Part0 = lArm
- lS.Part1 = torso
- lS.C0 =CFrame.new(-0.325 * 20, 0.643 * 20, 0) * CFrame.Angles(-math.rad(90), 0, 0)
- lS.C1 = CFrame.new(-0.65 * 40, 0.643 * 20, 0)
- rS = Instance.new("Motor6D",torso)
- rS.Name = "Right Shoulder"
- rS.Part0 =rArm
- rS.Part1 = torso
- rS.C0 = CFrame.new(-0.325 * 20, 0.643 * 20, 0) * CFrame.Angles(-math.rad(90), 0, 0)
- rS.C1 = CFrame.new(0.65 * 20, 0.643 * 20, 0)
- -- now for the real stuff
- -- |
- -- |
- -- V
- local Mouse = player:GetMouse()
- sound = Instance.new("Sound", head)
- sound.SoundId = "rbxassetid://4843501652"
- sound.Volume = 549867457586485
- sound:Play()
- sound.RollOffMode = Enum.RollOffMode.LinearSquare
- sound.Looped = true
- lS.C0 =CFrame.new(-0.325 * 20, 0.643 * 20, 0) * CFrame.Angles(-math.rad(90), 0, 0)
- lS.C1 = CFrame.new(-0.65 * 40, 0.643 * 20, 0)
- rS.C0 = CFrame.new(-0.325 * 20, 0.643 * 20, 0) * CFrame.Angles(-math.rad(90), 0, 0)
- rS.C1 = CFrame.new(0.65 * 20, 0.643 * 20, 0)
- RS:Connect(function()--math.rad(90)
- if dragged ~= nil and not dragged:FindFirstChild("draggedpuller") then
- draggedpuller = Instance.new("BodyPosition",dragged)
- rArm.Anchored = true
- head.Anchored = true
- draggedpuller.Position = Vector3.new(rArmPuller.Position.X,rArmPuller.Position.Y,rArmPuller.Position.Z)
- draggedpuller.Name = "draggedpuller"
- rArm.Changed:Connect(function()
- if draggedpuller then
- draggedpuller.Position = Vector3.new(rArmPuller.Position.X,rArmPuller.Position.Y,rArmPuller.Position.Z)
- end
- end)
- --draggedpuller.D = 9e9 * dragged:GetMass()
- --draggedpuller.P = 9e9 * dragged:GetMass()
- draggedpuller.MaxForce = Vector3.new(500000000, 500000000, 500000000)
- elseif dragged == nil then
- if draggedpuller then
- --dragged.Velocity = Vector3.new(0,0,0)
- draggedpuller.Parent = nil
- end
- end
- if rArmPuller:FindFirstChildOfClass("Weld") and dragging == false then
- rArmPuller:FindFirstChildOfClass("Weld"):Destroy()
- end
- rS.C0 = CFrame.new(-0.325 * 20, 0.643 * 20, 0) * CFrame.new(rArm.Position, Mouse.hit.p)
- lS.C0 = CFrame.new(-0.325 * 20, 0.643 * 20, 0) * CFrame.new(lArm.Position, Mouse.hit.p)
- end)
- --local camPart = char:WaitForChild("camPart")
- -- welding doesn't really work.
- --local cameraHandWeld = Instance.new("Motor6D", camPart)
- --cameraHandWeld.Part0 = camPart
- --cameraHandWeld.Part1 = cameraHand
- --cameraHandWeld.C0 = CFrame.new(5, 0, 0)
- neck = torso:FindFirstChild("Neck")
- neck.Part0 = head
- neck.Part1 = torso
- neck.C1 = CFrame.new(0, 0.975 * 20, 0)
- neck.C0 = CFrame.new(0, -0.65 * 20, 0)
- dragging = false
- Mouse.Button1Down:Connect(function()
- if Mouse.Target.Anchored == false and dragged == nil then
- dragging = true
- dragged = Mouse.Target
- end
- end)
- Mouse.Button1Up:Connect(function()
- if dragging == true and dragged ~= nil then
- rArm.Anchored = false
- head.Anchored = false
- dragged.Velocity = rArm.Velocity
- dragging = false
- dragged = nil
- end
- end)
- function snap(part)
- coroutine.resume(coroutine.create(function()
- part.Name = "Dust"
- part.Anchored = true
- part.CanCollide = true
- local smoke = Instance.new("ParticleEmitter", part)
- smoke.Size = NumberSequence.new({
- NumberSequenceKeypoint.new(0, 0.6),
- NumberSequenceKeypoint.new(1, 0.6)
- })
- coroutine.resume(coroutine.create(function()
- while wait(0.1) do
- part.Transparency = part.Transparency + 1
- end
- end))
- smoke.Texture = "rbxassetid://1494734425"
- smoke.Rate = 100
- smoke.Lifetime = NumberRange.new(0.6, 1.2)
- smoke.Speed = NumberRange.new(2, 5)
- smoke.SpreadAngle = Vector2.new(-30, 30)
- wait(0.07)
- smoke.Enabled = false
- wait(2)
- part:Destroy()
- end))
- end
- Mouse.KeyDown:Connect(function(key)
- if key == "n" then
- if Mouse.Target.Parent.ClassName == "Accessory" then
- accessory = Mouse.Target.Parent
- if accessory.Parent:FindFirstChildOfClass("Humanoid") and not accessory.Parent:FindFirstChildOfClass("Humanoid").Name == "SteveVR" then
- local snapped = accessory.Parent
- snapped:FindFirstChildOfClass("Humanoid").Health = 0
- if snapped:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R15 then
- snap(snapped.Head)
- wait()
- for i,v in pairs(snapped:GetChildren()) do
- if v.ClassName == "Accessory" then
- snap(v.Handle)
- end
- end
- snap(snapped.RightUpperArm)
- wait()
- snap(snapped.UpperTorso)
- wait()
- snap(snapped.RightLowerArm)
- wait()
- snap(snapped.LeftUpperArm)
- wait()
- snap(snapped.LowerTorso)
- wait()
- snap(snapped.RightHand)
- wait()
- snap(snapped.LeftLowerArm)
- wait()
- snap(snapped.RightUpperLeg)
- wait()
- snap(snapped.LeftHand)
- wait()
- snap(snapped.RightLowerLeg)
- wait()
- snap(snapped.LeftUpperLeg)
- wait()
- snap(snapped.RightFoot)
- wait()
- snap(snapped.LeftLowerLeg)
- wait()
- snap(snapped.LeftFoot)
- else
- snap(snapped.Head)
- wait()
- for i,v in pairs(snapped:GetChildren()) do
- if v.ClassName == "Accessory" then
- snap(v.Handle)
- end
- end
- snap(snapped["Right Arm"])
- wait()
- snap(snapped.Torso)
- wait()
- snap(snapped["Right Leg"])
- wait()
- snap(snapped["Left Arm"])
- wait()
- snap(snapped["Left Leg"])
- end
- end
- end
- if Mouse.Target.Parent:FindFirstChildOfClass("Humanoid") and accessory.Parent:FindFirstChildOfClass("Humanoid").Name ~= "SteveVR" then
- local snapped = Mouse.Target.Parent
- snapped:FindFirstChildOfClass("Humanoid").Health = 0
- if snapped:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R15 then
- snap(snapped.Head)
- wait()
- for i,v in pairs(snapped:GetChildren()) do
- if v.ClassName == "Accessory" then
- snap(v.Handle)
- end
- end
- snap(snapped.RightUpperArm)
- wait()
- snap(snapped.UpperTorso)
- wait()
- snap(snapped.RightLowerArm)
- wait()
- snap(snapped.LeftUpperArm)
- wait()
- snap(snapped.LowerTorso)
- wait()
- snap(snapped.RightHand)
- wait()
- snap(snapped.LeftLowerArm)
- wait()
- snap(snapped.RightUpperLeg)
- wait()
- snap(snapped.LeftHand)
- wait()
- snap(snapped.RightLowerLeg)
- wait()
- snap(snapped.LeftUpperLeg)
- wait()
- snap(snapped.RightFoot)
- wait()
- snap(snapped.LeftLowerLeg)
- wait()
- snap(snapped.LeftFoot)
- else
- snap(snapped.Head)
- wait()
- for i,v in pairs(snapped:GetChildren()) do
- if v.ClassName == "Accessory" then
- snap(v.Handle)
- end
- end
- snap(snapped["Right Arm"])
- wait()
- snap(snapped.Torso)
- wait()
- snap(snapped["Right Leg"])
- wait()
- snap(snapped["Left Arm"])
- wait()
- snap(snapped["Left Leg"])
- end
- end
- end
- end)
- Mouse.KeyDown:Connect(function(key)
- if key == "j" then
- for i,v in pairs(game.Workspace:GetChildren()) do
- if v:FindFirstChildOfClass("Humanoid") and v.Name ~= player.Name and v:FindFirstChildOfClass("Humanoid").Name ~= "SteveVR" then
- coroutine.resume(coroutine.create(function()
- local snapped = v
- snapped:FindFirstChildOfClass("Humanoid").Health = 0
- if snapped:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R15 then
- snap(snapped.Head)
- wait()
- for i,v in pairs(snapped:GetChildren()) do
- if v.ClassName == "Accessory" then
- snap(v.Handle)
- end
- end
- snap(snapped.RightUpperArm)
- wait()
- snap(snapped.UpperTorso)
- wait()
- snap(snapped.RightLowerArm)
- wait()
- snap(snapped.LeftUpperArm)
- wait()
- snap(snapped.LowerTorso)
- wait()
- snap(snapped.RightHand)
- wait()
- snap(snapped.LeftLowerArm)
- wait()
- snap(snapped.RightUpperLeg)
- wait()
- snap(snapped.LeftHand)
- wait()
- snap(snapped.RightLowerLeg)
- wait()
- snap(snapped.LeftUpperLeg)
- wait()
- snap(snapped.RightFoot)
- wait()
- snap(snapped.LeftLowerLeg)
- wait()
- snap(snapped.LeftFoot)
- else
- snap(snapped.Head)
- wait()
- for i,v in pairs(snapped:GetChildren()) do
- if v.ClassName == "Accessory" then
- snap(v.Handle)
- end
- end
- snap(snapped["Right Arm"])
- wait()
- snap(snapped.Torso)
- wait()
- snap(snapped["Right Leg"])
- wait()
- snap(snapped["Left Arm"])
- wait()
- snap(snapped["Left Leg"])
- end
- end))
- end
- end
- end
- end)
- --char.Torso.Anchored = true
- end
- end
Add Comment
Please, Sign In to add comment