Advertisement
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 = owner
- local Mouse,mouse,UserInputService,ContextActionService
- do
- script.Parent = Player.Character
- local CAS = {Actions={}}
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.Parent = Player.Character
- local fakeEvent = function()
- local t = {_fakeEvent=true}
- t.Connect = function(self,f)self.Function=f end
- t.connect = t.Connect
- return t
- end
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- function CAS:BindAction(name,fun,touch,...)
- CAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
- end
- function CAS:UnbindAction(name)
- CAS.Actions[name] = nil
- end
- 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
- elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
- if io.UserInputState == Enum.UserInputState.Begin then
- m:TrigEvent("Button1Down")
- else
- m:TrigEvent("Button1Up")
- end
- else
- for n,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
- if io.UserInputState == Enum.UserInputState.Begin then
- m:TrigEvent("KeyDown",io.KeyCode.Name:lower())
- UIS:TrigEvent("InputBegan",io,false)
- else
- m:TrigEvent("KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent("InputEnded",io,false)
- end
- end
- end)
- NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Char = Player.Character
- local Event = Char:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- local io = {KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
- Event:FireServer(io)
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Changed = false
- local Mouse = Player:GetMouse()
- local h,t = Mouse.Hit,Mouse.Target
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- Event:FireServer({isMouse=true,Target=Mouse.Target,Hit=Mouse.Hit})
- h,t=Mouse.Hit,Mouse.Target
- end
- end
- ]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- for i,v in next,workspace:children''do
- if(v:IsA'BasePart')then
- me=v;
- bbg=Instance.new('BillboardGui',me);
- bbg.Name='stuf';
- bbg.Adornee=me;
- bbg.Size=UDim2.new(9.5,0,2.5,0)
- --bbg.StudsOffset=Vector3.new(0,2,0)
- tlb=Instance.new'TextLabel';
- tlb.Text='HAHAHAHAHAHAHAHA';
- tlb.Font='Arcade';
- tlb.FontSize='Size48';
- tlb.TextColor3=Color3.new(1,0,0);
- tlb.Size=UDim2.new(1.25,0,1.25,0);
- tlb.Position=UDim2.new(-0.125,-22,-1.1,0);
- tlb.BackgroundTransparency=1;
- tlb.Parent=bbg;
- end;end;
- function xds(dd)
- for i,v in next,dd:children''do
- if(v:IsA'BasePart')then
- v.BrickColor=BrickColor.new'Really black';
- v.TopSurface='Smooth';
- v.BottomSurface='Smooth';
- s=Instance.new('SelectionBox',v);
- s.Adornee=v;
- s.Color=BrickColor.new'Really red';
- a=Instance.new('PointLight',v);
- a.Color=Color3.new(1,0,0);
- a.Range=99999999999999999999999999999;
- a.Brightness=99999999999999999999999999999999999999999;
- f=Instance.new('Fire',v);
- f.Size=9999999999;
- f.Heat=9999999999;
- end;
- game.Lighting.TimeOfDay=1;
- game.Lighting.Brightness=1;
- game.Lighting.ShadowColor=Color3.new(255,0,0);
- game.Lighting.Ambient=Color3.new(9,9,9);
- game.Lighting.FogEnd=200;
- game.Lighting.FogColor=Color3.new(0,0,0);
- local dec = 'http://www.roblox.com/asset/?id=19399245';
- local fac = {'Front', 'Back', 'Left', 'Right', 'Top', 'Bottom'}
- --coroutine.wrap(function()
- --for _,__ in pairs(fac) do
- --local ddec = Instance.new("Decal", v)
- --ddec.Face = __
- --ddec.Texture = dec
- --end end)()
- if #(v:GetChildren())>0 then
- xds(v)
- end
- end
- end
- xds(game.Workspace)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement