SHOW:
|
|
- or go back to the newest paste.
1 | - | ----[Created by OmegaHardcore99]---- |
1 | + | noises = {'rbxassetid://230287740','rbxassetid://271787597','rbxassetid://153752123','rbxassetid://271787503'} |
2 | skyNOOB = coroutine.create(function() | |
3 | - | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end |
3 | + | |
4 | - | local Player,Mouse,mouse,UserInputService,ContextActionService = owner |
4 | + | |
5 | - | do |
5 | + | |
6 | - | print("FE Compatibility code by Mokiros") |
6 | + | |
7 | - | script.Parent = Player.Character |
7 | + | |
8 | end) | |
9 | - | --RemoteEvent for communicating |
9 | + | |
10 | - | local Event = Instance.new("RemoteEvent") |
10 | + | |
11 | - | Event.Name = "UserInput_Event" |
11 | + | a.SoundId = "rbxassetid://141509625" |
12 | a.Name = "RAINING MEN" | |
13 | - | --Fake event to make stuff like Mouse.KeyDown work |
13 | + | |
14 | - | local function fakeEvent() |
14 | + | |
15 | - | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} |
15 | + | |
16 | - | t.connect = t.Connect |
16 | + | |
17 | - | return t |
17 | + | |
18 | if not rainin then | |
19 | a = Instance.new("Sound",workspace) | |
20 | - | --Creating fake input objects with fake variables |
20 | + | a.SoundId = "rbxassetid://141509625" |
21 | - | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} |
21 | + | |
22 | - | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} |
22 | + | |
23 | - | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) |
23 | + | |
24 | - | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil |
24 | + | |
25 | - | end} |
25 | + | |
26 | - | --Merged 2 functions into one by checking amount of arguments |
26 | + | |
27 | - | CAS.UnbindAction = CAS.BindAction |
27 | + | |
28 | ||
29 | - | --This function will trigger the events that have been :Connect()'ed |
29 | + | rain = coroutine.create(function() |
30 | - | local function te(self,ev,...) |
30 | + | while wait(10 % 1 * 1e2) do |
31 | - | local t = m[ev] |
31 | + | part = Instance.new("Part",workspace) |
32 | - | if t and t._fakeEvent and t.Function then |
32 | + | part.Name = "Toad" |
33 | - | t.Function(...) |
33 | + | |
34 | mesh = Instance.new("SpecialMesh",part) | |
35 | ||
36 | - | m.TrigEvent = te |
36 | + | sound = Instance.new("Sound",workspace) |
37 | - | UIS.TrigEvent = te |
37 | + | |
38 | part.CanCollide = false | |
39 | - | Event.OnServerEvent:Connect(function(plr,io) |
39 | + | part.Size = Vector3.new(440,530,380) |
40 | - | if plr~=Player then return end |
40 | + | part.Position = Vector3.new(math.random(-3000,1000),math.random(1,3000),math.random(-3000,3000)) |
41 | - | if io.isMouse then |
41 | + | |
42 | - | m.Target = io.Target |
42 | + | sound.SoundId = noises[math.random(1,#noises)] |
43 | - | m.Hit = io.Hit |
43 | + | sound:Play() |
44 | - | else |
44 | + | sound.Ended:connect(function() |
45 | - | local b = io.UserInputState == Enum.UserInputState.Begin |
45 | + | sound:Destroy() |
46 | - | if io.UserInputType == Enum.UserInputType.MouseButton1 then |
46 | + | end) |
47 | - | return m:TrigEvent(b and "Button1Down" or "Button1Up") |
47 | + | |
48 | - | end |
48 | + | |
49 | - | for _,t in pairs(CAS.Actions) do |
49 | + | mesh.MeshType = "FileMesh" |
50 | - | for _,k in pairs(t.Keys) do |
50 | + | mesh.MeshId = "rbxassetid://430210147" |
51 | - | if k==io.KeyCode then |
51 | + | mesh.TextureId = "rbxassetid://430210159" |
52 | - | t.Function(t.Name,io.UserInputState,io) |
52 | + | |
53 | - | end |
53 | + | |
54 | - | end |
54 | + | |
55 | - | end |
55 | + | |
56 | - | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) |
56 | + | |
57 | - | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) |
57 | + | coroutine.resume(rain) |