Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- FE template created by MintyLatios (V3rm) aka Drahazar (ROBLOX)
- --Fixed by basstracker1970
- local ownerval = Instance.new("ObjectValue")
- ownerval.Name = "Owner"
- ownerval.Value = owner
- ownerval.Parent = script
- local username = "basstracker1970"
- if(script:FindFirstChild'Owner')then
- repeat wait() until script.Owner.Value
- end
- function GetPlr(user)
- for _,v in next, game:service'Players':players() do
- if(v.Name==user)then
- return v
- end
- end
- return nil
- end
- local owner = script:WaitForChild'Owner'.Value
- repeat wait() until script:WaitForChild'Owner'.Value
- local Player = script:WaitForChild'Owner'.Value
- local Mouse,mouse,UserInputService,ContextActionService
- script.Owner:destroy()
- local scriptName = "Aprins"
- do
- local GUID = {}
- do
- GUID.IDs = {};
- function GUID:new(len)
- local id;
- if(not len)then
- id = (tostring(function() end))
- id = id:gsub("function: ","")
- else
- local function genID(len)
- local newID = ""
- for i = 1,len do
- newID = newID..string.char(math.random(48,90))
- end
- return newID
- end
- repeat id = genID(len) until not GUID.IDs[id]
- local oid = id;
- id = {Trash=function() GUID.IDs[oid]=nil; end;Get=function() return oid; end}
- GUID.IDs[oid]=true;
- end
- return id
- end
- end
- local AHB = Instance.new("BindableEvent")
- local FPS = 30
- local TimeFrame = 0
- local LastFrame = tick()
- local Frame = 1/FPS
- game:service'RunService'.Heartbeat:connect(function(s,p)
- TimeFrame = TimeFrame + s
- if(TimeFrame >= Frame)then
- for i = 1,math.floor(TimeFrame/Frame) do
- AHB:Fire()
- end
- LastFrame=tick()
- TimeFrame=TimeFrame-Frame*math.floor(TimeFrame/Frame)
- end
- end)
- function swait(dur)
- if(dur == 0 or typeof(dur) ~= 'number')then
- AHB.Event:wait()
- else
- for i = 1, dur*FPS do
- AHB.Event:wait()
- end
- end
- end
- oPlayer = Player
- Player = oPlayer
- local loudnesses={}
- script.Parent = Player.Character
- CoAS = {Actions={}}
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInputEvent"
- Event.Parent = Player.Character
- local Func = Instance.new("RemoteFunction")
- Func.Name = "GetClientProperty"
- Func.Parent = Player.Character
- local fakeEvent = function()
- local t = {_fakeEvent=true,Waited={},Connected={}}
- t.Connect = function(self,f)
- local ft={}
- ft={Disconnected=false;disconnect=function(s) if(self.Function==ft)then self.Function=nil end s.Disconnected=true end}
- ft.Disconnect=ft.disconnect
- ft.Func=function(...)
- for id,_ in next, t.Waited do
- t.Waited[id] = true
- end
- return f(...)
- end;
- table.insert(self.Connected,ft)
- return ft;
- end
- t.connect = t.Connect
- t.Wait = function()
- local guid = GUID:new(25)
- local waitingId = guid:Get()
- t.Waited[waitingId]=false
- repeat swait() until t.Waited[waitingId]==true
- t.Waited[waitingId]=nil;
- guid:Trash()
- end
- t.wait = t.Wait
- return t
- end
- m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- UsIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- Run = {RenderStepped=fakeEvent()}
- function CoAS:BindAction(name,fun,touch,...)
- CoAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
- end
- function CoAS:UnbindAction(name)
- CoAS.Actions[name] = nil
- end
- local function te(self,ev,...)
- local t = self[ev]
- if t and t._fakeEvent and t.Connected then
- for i,v in next, t.Connected do
- if(v.Func and not v.Disconnected)then
- v.Func(...)
- else
- t.Connected[i]=nil
- end
- end
- end
- end
- m.TrigEvent = te
- UsIS.TrigEvent = te
- Run.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io,...)
- if io.Mouse then
- m.Target = io.Target
- m.Hit = io.Hit
- elseif io.KeyEvent then
- m:TrigEvent('Key'..io.KeyEvent,io.Key)
- elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
- if io.UserInputState == Enum.UserInputState.Begin then
- m:TrigEvent("Button1Down")
- else
- m:TrigEvent("Button1Up")
- end
- end
- if(not io.KeyEvent and not io.Mouse)then
- for n,t in pairs(CoAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- if io.UserInputState == Enum.UserInputState.Begin then
- UsIS:TrigEvent("InputBegan",io,false)
- else
- UsIS:TrigEvent("InputEnded",io,false)
- end
- end
- local varargs={...}
- --remote:FireServer("MouseEventCall",event,...)
- if(type=='MouseEventCall')then
- local event = table.remove(varargs,1)
- if(m[event])then
- Event:FireAllClients(event,unpack(varargs))
- m:TrigEvent(event,unpack(varargs))
- end
- elseif(type=='MouseUpdate')then
- m.Target = varargs[1].Target
- m.Hit = varargs[1].Hit
- Event:FireAllClients("UpdatePos",m.Target,m.Hit)
- end
- end)
- Func.OnServerInvoke = function(plr,inst,play)
- if plr~=Player then return end
- if(inst and typeof(inst) == 'Instance' and inst:IsA'Sound')then
- loudnesses[inst]=play
- end
- end
- function GetClientProperty(inst,prop)
- if(prop == 'PlaybackLoudness' and loudnesses[inst])then
- return loudnesses[inst]
- elseif(prop == 'PlaybackLoudness')then
- return Func:InvokeClient(Player,'RegSound',inst)
- end
- return Func:InvokeClient(Player,inst,prop)
- end
- NLS ([=[
- local me = game:service'Players'.localPlayer;
- local mouse = me:GetMouse();
- local UIS = game:service'UserInputService'
- local ch = me.Character;
- local UserEvent = ch:WaitForChild('UserInputEvent',30)
- UIS.InputChanged:connect(function(io,gpe)
- if(io.UserInputType == Enum.UserInputType.MouseMovement)then
- UserEvent:FireServer{Mouse=true,Target=mouse.Target,Hit=mouse.Hit}
- end
- end)
- mouse.Changed:connect(function(o)
- if(o == 'Target' or o == 'Hit')then
- UserEvent:FireServer{Mouse=true,Target=mouse.Target,Hit=mouse.Hit}
- end
- end)
- UIS.InputBegan:connect(function(io,gpe)
- if(gpe)then return end
- UserEvent:FireServer{InputObject=true,KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
- end)
- UIS.InputEnded:connect(function(io,gpe)
- if(gpe)then return end
- UserEvent:FireServer{InputObject=true,KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
- end)
- mouse.KeyDown:connect(function(k)
- UserEvent:FireServer{KeyEvent='Down',Key=k}
- end)
- mouse.KeyUp:connect(function(k)
- UserEvent:FireServer{KeyEvent='Up',Key=k}
- end)
- local ClientProp = ch:WaitForChild('GetClientProperty',30)
- local sounds = {}
- function regSound(o)
- if(o:IsA'Sound')then
- local lastLoudness = o.PlaybackLoudness
- ClientProp:InvokeServer(o,lastLoudness)
- table.insert(sounds,{o,lastLoudness})
- --ClientProp:InvokeServer(o,o.PlaybackLoudness)
- end
- end
- ClientProp.OnClientInvoke = function(inst,prop)
- if(inst == 'RegSound')then
- regSound(prop)
- for i = 1, #sounds do
- if(sounds[i][1] == prop)then
- return sounds[i][2]
- end
- end
- else
- return inst[prop]
- end
- end
- for _,v in next, workspace:GetDescendants() do regSound(v) end
- workspace.DescendantAdded:connect(regSound)
- me.Character.DescendantAdded:connect(regSound)
- game:service'RunService'.RenderStepped:connect(function()
- for i = 1, #sounds do
- local tab = sounds[i]
- local object,last=unpack(tab)
- if(object.PlaybackLoudness ~= last)then
- sounds[i][2]=object.PlaybackLoudness
- ClientProp:InvokeServer(object,sounds[i][2])
- end
- end
- end)
- ]=], owner.PlayerGui);
- ----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 m end},Player)
- },"Players"),
- UserInputService = FakeService(UsIS,"UserInputService"),
- ContextActionService = FakeService(CoAS,"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
- LoadLibrary=function(lib)
- if(lib:lower()=="rbxutility")then
- return setmetatable({
- Create = function(ty)
- return function(data)
- local obj = Instance.new(ty)
- for k, v in pairs(data) do
- if type(k) == 'number' then
- v.Parent = obj
- else
- obj[k] = v
- end
- end
- return obj
- end
- end
- },{__index=function(_,v) return ({})[v] end})
- else
- return {}
- end
- end
- -----PASTE SCRIPTS BELOW THIS LINE DO NOT TOUCH ANY OF THE CODE ABOVE THIS LINE
Add Comment
Please, Sign In to add comment