Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This script has been converted to FE by iPxter
- -- And edited by animescapetower
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.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,Connect=function(self,f)self.Function=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()}
- 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 and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- 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 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})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- 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)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- _G.owner,player,playe,play,pla,pl,p = owner
- _G.mouse = mouse
- _G.Mouse = Mouse
- _G.UserInputService = UserInputService
- _G.ContextActionService = ContextActionService
- _G.Metatype = function(table_)
- for _,t in ipairs(table_) do
- local tables,tab,t = t,t,t
- print(type(tables))
- print(t)
- end
- return table_
- end
- _G.CreateSound = function(id,vol,pitch)
- sound1 = Instance.new("Sound")
- sound1.Volume = vol
- sound1.PlaybackSpeed = pitch
- sound1.SoundId = "rbxassetid://"..id
- sound1.Parent = workspace
- sound1:Play()
- wait(sound1.TimeLength)
- sound1:Destroy()
- end
- _G.Destroy = function(object)
- if object ~= nil then
- object:Destroy()
- end
- end
- _G.Unlock = function(object)
- if object ~= nil then
- object.Locked = false
- end
- end
- _G.UnlockAll = function()
- while wait() do
- for _,n in ipairs(workspace:GetChildren()) do
- if n.ClassName == "Part" or n.ClassName == "MeshPart" then
- n.Locked = false
- end
- end
- for _,n3 in ipairs(workspace:GetChildren()) do
- if n3.ClassName == "Model" then
- for _,n2 in ipairs(n3:GetChildren()) do
- if n2.ClassName == "Part" or n2.ClassName == "MeshPart" then
- n2.Locked = false
- end
- end
- end
- for _,n4 in ipairs(n3:GetChildren()) do
- if n4.ClassName == "Model" then
- for _,n5 in ipairs(n4:GetChildren()) do
- if n5.ClassName == "Part" or n5.ClassName == "MeshPart" then
- n5.Locked = false
- end
- end
- end
- end
- end
- end
- end
- _G.DestroyAll = function()
- for _,n in ipairs(workspace:GetChildren()) do
- if n.ClassName == "Part" or n.ClassName == "MeshPart" then
- n:Destroy()
- end
- end
- for _,n3 in ipairs(workspace:GetChildren()) do
- if n3.ClassName == "Model" then
- for _,n2 in ipairs(n3:GetChildren()) do
- if n2.ClassName == "Part" or n2.ClassName == "MeshPart" then
- n2:Destroy()
- end
- end
- end
- for _,n4 in ipairs(n3:GetChildren()) do
- if n4.ClassName == "Model" then
- for _,n5 in ipairs(n4:GetChildren()) do
- if n5.ClassName == "Part" or n5.ClassName == "MeshPart" then
- n5:Destroy()
- end
- end
- end
- end
- end
- end
- e,e2 =workspace:WaitForChild("Base"), workspace:WaitForChild("Baseplate")
- k = workspace:GetChildren()
- _G.k = k
- _G.e = e
- _G.e2 = e
- clonedtables = {}
- _G.clonestables = clonedtables
- for _, k2 in ipairs(k) do
- if k2.ClassName == "Part" or k2.ClassName == "MeshPart" or k2.ClassName == "UnionOperation" then
- l = k:Clone()
- table.insert(clonedtables,k)
- end
- end
- while wait(.1) do
- for _,c in ipairs(clonedtables) do
- e254 = c:Clone()
- e254.Parent = workspace
- wait(0.1)
- e254:Destroy()
- end
- end
- -- [[
- --
- --so uh any player prefixes in scripts or this [game.Players.LocalPlayer] or this [game:GetService("Players").LocalPlayer] should be ---renamed to owner and also don't forget the mouses to so change player:GetMouse() to mouse or Mouse if you need to.
- --
- --To note : I however did not make this ask mokiros and you can see on the 2 lines of text 1 line : This script has been converted to --FE by iPxter : 2nd line : And edited by animescapetower to work on all scripts, ok bye
- --
- --
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement