Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- 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 V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- 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 TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(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
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled 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 every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true 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
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __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 RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame: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(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- slapspeedddd = 2
- clickmove = false
- plr = owner
- repeat wait() until plr.Character
- char = plr.Character
- humanoid = char.Humanoid
- humanoid.WalkSpeed = 50
- humanoid.Name = "Principal"
- happy = true
- humanoid.JumpPower = 0
- humanoid.Animator:Destroy()
- char.Animate:Destroy()
- char.Head:FindFirstChildOfClass("Decal"):Destroy()
- billboardgui = Instance.new("BillboardGui",char.Head)
- billboardgui.Size = UDim2.new(5, 0,9, 0)
- billboardgui.MaxDistance = math.huge
- billboardgui.ZIndexBehavior = "Global"
- billboardgui.LightInfluence = 1
- billboardgui.Enabled = true
- frame = Instance.new("Frame",billboardgui)
- frame.Size = UDim2.new(1, 0,1, 0)
- frame.Position = UDim2.new(0, 0,0, 0)
- frame.BackgroundTransparency = 1
- image = Instance.new("ImageLabel",frame)
- image.Image = "rbxassetid://1838288441"
- image.BackgroundTransparency = 1
- image.ScaleType = "Fit"
- image.Position = UDim2.new(0, 1,0, 1)
- image.Size = UDim2.new(1, 0,1, 0)
- local slap = Instance.new("Sound",char.Head)
- slap.SoundId = "rbxassetid://1804495872"
- slap.Volume = 10
- local theme = Instance.new("Sound",char.Head)
- theme.SoundId = "rbxassetid://1828370087"
- theme.Volume = 10
- theme.Looped = true
- local ohhi = Instance.new("Sound",char.Head)
- ohhi.SoundId = "rbxassetid://3101790973"
- ohhi.Volume = 10
- local congrats = Instance.new("Sound",char)
- congrats.SoundId = "rbxassetid://1846448410"
- congrats.Volume = 10
- local death = Instance.new("Sound",char)
- death.SoundId = "rbxassetid://1857731449"
- death.Volume = 10
- local doors = Instance.new("Sound",char)
- doors.SoundId = "rbxassetid://1847298619"
- doors.Volume = 10
- mouse = plr:GetMouse()
- SpeedofBaldi = 40
- using = false
- char.Torso.Touched:connect(function(part)
- local human = part.Parent:FindFirstChildOfClass("Humanoid")
- if human and using == false and human.Name ~= "BadStudent" then
- using = true
- human.Name = "BadStudent"
- function decal(face,part,texture)
- decal = Instance.new("Decal",part)
- decal.Face = face
- decal.Texture = texture
- end
- function texture(face,part,texture,U,V)
- decal = Instance.new("Texture",part)
- decal.Face = face
- decal.Texture = texture
- decal.StudsPerTileU = U
- decal.StudsPerTileV = V
- end
- function tablebaldi(orientation,cframe1)
- tablee1 = Instance.new("Part",detentionmodel)
- tablee1.Size = Vector3.new(3, 3, 3)
- tablee1.Color = Color3.fromRGB(174, 143, 39)
- tablee1.Anchored = false
- tablee1.Orientation = orientation
- tablee2 = Instance.new("Part",detentionmodel)
- tablee2.Size = Vector3.new(3, 3, 3)
- tablee2.Color = Color3.fromRGB(174, 143, 39)
- tablee2.Anchored = false
- tablee2.Orientation = orientation
- tablee3 = Instance.new("Part",detentionmodel)
- tablee3.TopSurface = 0
- tablee3.BottomSurface = 0
- tablee3.Size = Vector3.new(3.8, 0.3, 9.8)
- tablee3.Color = Color3.fromRGB(174, 143, 39)
- tablee3.Anchored = true
- tablee3.Orientation = orientation
- tablee3.CFrame = cframe1 * CFrame.new(0,2.6,0) * CFrame.Angles(math.rad(orientation.X),math.rad(orientation.Y),math.rad(orientation.Z))
- weld = Instance.new("Weld",tablee1)
- weld.Part0 = tablee3
- weld.Part1 = tablee1
- weld.C0 = CFrame.new(0,-1.6,-3)
- weld2 = Instance.new("Weld",tablee1)
- weld2.Part0 = tablee3
- weld2.Part1 = tablee2
- weld2.C0 = CFrame.new(0,-1.6,3)
- end
- function makepart(classname,size,position,transparency,orientation,parent,cancollide,name)
- newpart = Instance.new(classname,parent)
- newpart.Size = size
- newpart.Position = position
- newpart.Transparency = transparency
- newpart.Orientation = orientation
- newpart.CanCollide = cancollide
- newpart.Anchored = true
- newpart.Name = name
- end
- detentionmodel = Instance.new("Model",workspace)
- detentionmodel.Name = "detention"
- light = Instance.new("Model",detentionmodel)
- light.Name = "Light"
- light1 = Instance.new("Part",light)
- light1.Position = Vector3.new(-1.227, 0.55, -7.955)
- light1.Size = Vector3.new(2, 0.2, 2)
- light1.CanCollide = false
- light1.Transparency = 1
- light1.Anchored = true
- light1.Name = "Light"
- brightlight1 = Instance.new("PointLight",light1)
- brightlight1.Brightness = 1
- brightlight1.Range = 40
- brightlight1.Color = Color3.fromRGB(255,255,255)
- brightlight1.Shadows = false
- light2 = Instance.new("Part",light)
- light2.Position = Vector3.new(-1.227, 0.55, 2.245)
- light2.Size = Vector3.new(2, 0.2, 2)
- light2.CanCollide = false
- light2.Transparency = 1
- light2.Anchored = true
- light2.Name = "Light"
- brightlight2 = Instance.new("PointLight",light2)
- brightlight2.Brightness = 1
- brightlight2.Range = 40
- brightlight2.Color = Color3.fromRGB(255,255,255)
- brightlight2.Shadows = false
- part1 = makepart("Part",Vector3.new(8, 0.4, 8),Vector3.new(-5.005, 0.25, -3.02),1,Vector3.new(0, -90, 0),detentionmodel,false,"tele2")
- part2 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(5.995, 6.049, -29.97),1,Vector3.new(0, 0, 0),detentionmodel,true,2)
- texture("Front",detentionmodel:WaitForChild("2"),"rbxassetid://1855034340",12,12)
- texture("Back",detentionmodel:WaitForChild("2"),"rbxassetid://1855034340",12,12)
- part3 = makepart("Part",Vector3.new(48.01, 0.05, 60.01),Vector3.new(0, 12.074, 0),0,Vector3.new(0, 0, 0),detentionmodel,true,3)
- texture("Bottom",detentionmodel:WaitForChild("3"),"rbxassetid://1855172128",10,10)
- texture("Top",detentionmodel:WaitForChild("3"),"rbxassetid://109519029",10,10)
- part4 = makepart("Part",Vector3.new(0.05, 12, 12),Vector3.new(23.971, 6.049, -23.994),0,Vector3.new(0, 0, 0),detentionmodel,true,4)
- texture("Right",detentionmodel:WaitForChild("4"),"rbxassetid://1855008797",6,6)
- texture("Left",detentionmodel:WaitForChild("4"),"rbxassetid://1855008797",6,6)
- texture("Front",detentionmodel:WaitForChild("4"),"rbxassetid://1855008797",6,6)
- texture("Back",detentionmodel:WaitForChild("4"),"rbxassetid://1855008797",6,6)
- part5 = makepart("Part",Vector3.new(1, 1.2, 1),Vector3.new(-13.729, 3.253, -20.872),1,Vector3.new(0, 0, 0),detentionmodel,true,5)
- part6 = makepart("Part",Vector3.new(1, 1.2, 1),Vector3.new(9.271, 3.253, 16.128),1,Vector3.new(0, 0, 0),detentionmodel,true,6)
- part7 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(17.829, 6.049, 29.964),0,Vector3.new(0, 0, 0),detentionmodel,true,7)
- texture("Front",detentionmodel:WaitForChild("7"),"rbxassetid://1876923198",12,12)
- texture("Back",detentionmodel:WaitForChild("7"),"rbxassetid://1855008797",6,6)
- part8 = makepart("Part",Vector3.new(0.05, 12, 12),Vector3.new(23.971, 6.049, 12.006),0,Vector3.new(0, 0, 0),detentionmodel,true,8)
- texture("Left",detentionmodel:WaitForChild("8"),"rbxassetid://1866638381",12,12)
- texture("Right",detentionmodel:WaitForChild("8"),"rbxassetid://1855008797",6,6)
- part9 = makepart("Part",Vector3.new(1, 1.2, 1),Vector3.new(13.271, 3.253, -20.872),1,Vector3.new(0, 0, 0),detentionmodel,true,9)
- part10 = makepart("Part",Vector3.new(1, 1.2, 1),Vector3.new(-8.729, 3.253, 16.128),1,Vector3.new(0, 0, 0),detentionmodel,true,10)
- part11 = makepart("Part",Vector3.new(1, 1.2, 1),Vector3.new(4.271, 3.253, 21.128),1,Vector3.new(0, 0, 0),detentionmodel,true,11)
- part12 = makepart("Part",Vector3.new(0.05, 12, 12),Vector3.new(23.971, 6.049, 0.006),0,Vector3.new(0, 0, 0),detentionmodel,true,12)
- texture("Left",detentionmodel:WaitForChild("12"),"rbxassetid://1866637183",12,12)
- texture("Right",detentionmodel:WaitForChild("12"),"rbxassetid://1855008797",6,6)
- part13 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(-24.029, 6.049, -23.995),1,Vector3.new(0, 90, 0),detentionmodel,true,13)
- texture("Front",detentionmodel:WaitForChild("13"),"rbxassetid://1855034340",12,12)
- texture("Back",detentionmodel:WaitForChild("13"),"rbxassetid://1855034340",12,12)
- part14 = makepart("Part",Vector3.new(1, 1.2, 1),Vector3.new(-20.729, 3.253, 22.128),1,Vector3.new(0, 0, 0),detentionmodel,true,14)
- part15 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(-24.029, 6.049, 12.005),1,Vector3.new(0, 90, 0),detentionmodel,true,15)
- texture("Front",detentionmodel:WaitForChild("15"),"rbxassetid://1855034340",12,12)
- texture("Back",detentionmodel:WaitForChild("15"),"rbxassetid://1855034340",12,12)
- part16 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(-6.005, 6.049, 29.964),0,Vector3.new(0, 0, 0),detentionmodel,true,16)
- texture("Front",detentionmodel:WaitForChild("16"),"rbxassetid://1866653531",12,12)
- texture("Back",detentionmodel:WaitForChild("16"),"rbxassetid://1855008797",6,6)
- part17 = makepart("Part",Vector3.new(1, 1.2, 1),Vector3.new(-1.729, 3.253, 21.128),1,Vector3.new(0, 0, 0),detentionmodel,true,17)
- part18 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(17.995, 6.049, -29.97),0,Vector3.new(0, 0, 0),detentionmodel,true,18)
- texture("Back",detentionmodel:WaitForChild("18"),"rbxassetid://1866639041",12,12)
- texture("Front",detentionmodel:WaitForChild("18"),"rbxassetid://1855008797",6,6)
- part19 = makepart("Part",Vector3.new(48, 0.05, 60),Vector3.new(-0.005, 0.025, -0.02),0,Vector3.new(0, 0, 0),detentionmodel,true,19)
- texture("Top",detentionmodel:WaitForChild("19"),"rbxassetid://1855094371",5,5)
- part20 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(-18.005, 6.049, 29.964),0,Vector3.new(0, 0, 0),detentionmodel,true,20)
- texture("Front",detentionmodel:WaitForChild("20"),"rbxassetid://1866637793",12,12)
- texture("Back",detentionmodel:WaitForChild("20"),"rbxassetid://1855008797",6,6)
- part21 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(-6.005, 6.049, -29.97),0,Vector3.new(0, 0, 0),detentionmodel,true,21)
- texture("Back",detentionmodel:WaitForChild("21"),"rbxassetid://1866638854",12,12)
- texture("Front",detentionmodel:WaitForChild("21"),"rbxassetid://1855008797",6,6)
- part22 = makepart("Part",Vector3.new(0.05, 12, 6.4),Vector3.new(-24.029, 6.049, 3.106),0,Vector3.new(0, 0, 0),detentionmodel,true,22)
- texture("Left",detentionmodel:WaitForChild("22"),"rbxassetid://1855008797",6,6)
- texture("Right",detentionmodel:WaitForChild("22"),"rbxassetid://1855008797",6,6)
- part23 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(5.995, 6.049, 29.964),0,Vector3.new(0, 0, 0),detentionmodel,true,23)
- texture("Front",detentionmodel:WaitForChild("23"),"rbxassetid://1861499453",12,12)
- texture("Back",detentionmodel:WaitForChild("23"),"rbxassetid://1855008797",6,6)
- part24 = makepart("Part",Vector3.new(0.05, 12, 12),Vector3.new(23.971, 6.049, -11.994),0,Vector3.new(0, 0, 0),detentionmodel,true,24)
- texture("Right",detentionmodel:WaitForChild("24"),"rbxassetid://1855008797",6,6)
- texture("Left",detentionmodel:WaitForChild("24"),"rbxassetid://1855008797",6,6)
- texture("Front",detentionmodel:WaitForChild("24"),"rbxassetid://1855008797",6,6)
- texture("Back",detentionmodel:WaitForChild("24"),"rbxassetid://1855008797",6,6)
- part25 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(23.971, 6.049, 24.005),1,Vector3.new(0, 90, 0),detentionmodel,true,25)
- texture("Front",detentionmodel:WaitForChild("25"),"rbxassetid://1855034340",12,12)
- texture("Back",detentionmodel:WaitForChild("25"),"rbxassetid://1855034340",12,12)
- part26 = makepart("Part",Vector3.new(12, 12, 0.05),Vector3.new(-18.005, 6.049, -29.97),0,Vector3.new(0, 0, 0),detentionmodel,true,26)
- texture("Right",detentionmodel:WaitForChild("26"),"rbxassetid://1855008797",6,6)
- texture("Left",detentionmodel:WaitForChild("26"),"rbxassetid://1855008797",6,6)
- texture("Front",detentionmodel:WaitForChild("26"),"rbxassetid://1855008797",6,6)
- texture("Back",detentionmodel:WaitForChild("26"),"rbxassetid://1855008797",6,6)
- part27 = makepart("Part",Vector3.new(0.05, 12, 12),Vector3.new(-24.029, 6.049, -11.994),0,Vector3.new(0, 0, 0),detentionmodel,true,27)
- texture("Right",detentionmodel:WaitForChild("27"),"rbxassetid://1866637185",12,12)
- texture("Left",detentionmodel:WaitForChild("27"),"rbxassetid://1855008797",6,6)
- part28 = makepart("Part",Vector3.new(0.05, 12, 12),Vector3.new(-24.029, 6.049, 24.006),0,Vector3.new(0, 0, 0),detentionmodel,true,28)
- texture("Right",detentionmodel:WaitForChild("28"),"rbxassetid://1855008797",6,6)
- texture("Left",detentionmodel:WaitForChild("28"),"rbxassetid://1855008797",6,6)
- texture("Front",detentionmodel:WaitForChild("28"),"rbxassetid://1855008797",6,6)
- texture("Back",detentionmodel:WaitForChild("28"),"rbxassetid://1855008797",6,6)
- door = Instance.new("Part",detentionmodel)
- door.Size = Vector3.new(0.05, 12, 6)
- door.Position = Vector3.new(-24.029, 6.049, -2.994)
- door.Transparency = 1
- door.Anchored = true
- decal = Instance.new("Decal",door)
- decal.Face = "Left"
- decal.Texture = "http://www.roblox.com/asset/?id=1804020342"
- decall = Instance.new("Decal",door)
- decall.Face = "Right"
- decall.Texture = "http://www.roblox.com/asset/?id=1804020342"
- tablebaldi(Vector3.new(0, 0, 0),CFrame.new(9.195, 0.549, 23.136))
- tablebaldi(Vector3.new(0, -90, 0),CFrame.new(18.195, 0.549, -20.864))
- tablebaldi(Vector3.new(0, 90, 0),CFrame.new(-12.805, 0.549, 16.136))
- tablebaldi(Vector3.new(0, 180, 0),CFrame.new(-20.805, 0.549, 18.136))
- tablebaldi(Vector3.new(0, 90, 0),CFrame.new(1.195, 0.549, 21.136))
- tablebaldi(Vector3.new(0, -90, 0),CFrame.new(-17.604, 0.549, -20.864))
- tablebaldi(Vector3.new(0, -90, 0),CFrame.new(8.396, 0.549, -20.864))
- tablebaldi(Vector3.new(0, 0, 0),CFrame.new(9.195, 0.549, 12.136))
- detentionmodel:MoveTo(Vector3.new(0,-10,0))
- if part.Parent:FindFirstChild("HumanoidRootPart") then
- part.Parent.HumanoidRootPart.CFrame = detentionmodel.tele2.CFrame
- elseif part.Parent:FindFirstChild("Torso") then
- part.Parent.Torso.CFrame = detentionmodel.tele2.CFrame
- end
- doors:Play()
- wait(0.1)
- using = false
- end
- end)
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == "Part" then
- v.Transparency = 1
- elseif v.ClassName == "Accessory" then
- v.Handle.Transparency = 1
- end
- end
- mouse.KeyDown:connect(function(key)
- if key == "p" then
- ohhi:Play()
- end
- end)
- mouse.Button1Down:connect(function()
- move()
- end)
- function move()
- death:Play()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement