Advertisement
InTesting

g/pt Safe Haven

Feb 1st, 2019
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.01 KB | None | 0 0
  1. -- Instructions:
  2. --[[
  3. Any local variables with :
  4.  = LocalPlayer:
  5.     Must be replaced with "owner". So if your local variable is game.Players.LocalPlayer , replace it with owner
  6.  = :GetMouse():
  7.     Remove the variable entirely.
  8.  
  9. then paste this over the desired script
  10. --]]
  11.  
  12. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  13. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  14. do
  15.     print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  16.     script.Parent = Player.Character
  17.  
  18.     --RemoteEvent for communicating
  19.     local Event = Instance.new("RemoteEvent")
  20.     Event.Name = "UserInput_Event"
  21.     --Fake event to make stuff like Mouse.KeyDown work
  22.     local function fakeEvent()
  23.         local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  24.         t.connect = t.Connect
  25.         return t
  26.     end
  27.     --Creating fake input objects with fake variables
  28.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  29.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  30.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  31.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  32.     end}
  33.     --Merged 2 functions into one by checking amount of arguments
  34.     CAS.UnbindAction = CAS.BindAction
  35.  
  36.     --This function will trigger the events that have been :Connect()'ed
  37.     local function te(self,ev,...)
  38.         local t = m[ev]
  39.         if t and t._fakeEvent and t.Function then
  40.             t.Function(...)
  41.         end
  42.     end
  43.     m.TrigEvent = te
  44.     UIS.TrigEvent = te
  45.     Event.OnServerEvent:Connect(function(plr,io)
  46.         if plr~=Player then return end
  47.         if io.isMouse then
  48.             m.Target = io.Target
  49.             m.Hit = io.Hit
  50.         else
  51.             local b = io.UserInputState == Enum.UserInputState.Begin
  52.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  53.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  54.             end
  55.             for _,t in pairs(CAS.Actions) do
  56.                 for _,k in pairs(t.Keys) do
  57.                     if k==io.KeyCode then
  58.                         t.Function(t.Name,io.UserInputState,io)
  59.                     end
  60.                 end
  61.             end
  62.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  63.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  64.         end
  65.     end)
  66.     Event.Parent = NLS([==[
  67.     local Player = game:GetService("Players").LocalPlayer
  68.     local Event = script:WaitForChild("UserInput_Event")
  69.     local UIS = game:GetService("UserInputService")
  70.     local input = function(io,a)
  71.         if a then return end
  72.         --Since InputObject is a client-side instance, we create and pass table instead
  73.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  74.     end
  75.     UIS.InputBegan:Connect(input)
  76.     UIS.InputEnded:Connect(input)
  77.     local Mouse = Player:GetMouse()
  78.     local h,t
  79.     --Give the server mouse data 30 times every second, but only if the values changed
  80.     --If player is not moving their mouse, client won't fire events
  81.     while wait(1/30) do
  82.         if h~=Mouse.Hit or t~=Mouse.Target then
  83.             h,t=Mouse.Hit,Mouse.Target
  84.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  85.         end
  86.     end]==],Player.Character)
  87.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  88. end
  89. -- End of FE converter
  90. Trusted=0
  91. if owner.Name=="SoftlockedUnderZero" then
  92.     Trusted=1000
  93. end
  94. local ran1 = math.random(1,5)
  95. local ran2 = math.random(1,5)
  96.  
  97. local part =  Instance.new("Part",owner.Character)
  98. part.Position = Vector3.new(Trusted,ran1*1000,ran2*1000)
  99. part.Size = Vector3.new(5,2,5)
  100. part.Anchored = true
  101. part.Material = Enum.Material.Neon
  102. owner.Character.HumanoidRootPart.CFrame = CFrame.new(part.Position) *CFrame.new(0,3,0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement