SHOW:
|
|
- or go back to the newest paste.
1 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
2 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
3 | do | |
4 | script.Parent = Player.Character | |
5 | ||
6 | --RemoteEvent for communicating | |
7 | local Event = Instance.new("RemoteEvent") | |
8 | Event.Name = "UserInput_Event" | |
9 | ||
10 | --Fake event to make stuff like Mouse.KeyDown work | |
11 | local function fakeEvent() | |
12 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
13 | t.connect = t.Connect | |
14 | return t | |
15 | end | |
16 | ||
17 | --Creating fake input objects with fake variables | |
18 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
19 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
20 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
21 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
22 | end} | |
23 | --Merged 2 functions into one by checking amount of arguments | |
24 | CAS.UnbindAction = CAS.BindAction | |
25 | ||
26 | --This function will trigger the events that have been :Connect()'ed | |
27 | local function te(self,ev,...) | |
28 | local t = m[ev] | |
29 | if t and t._fakeEvent and t.Function then | |
30 | t.Function(...) | |
31 | end | |
32 | end | |
33 | m.TrigEvent = te | |
34 | UIS.TrigEvent = te | |
35 | ||
36 | Event.OnServerEvent:Connect(function(plr,io) | |
37 | if plr~=Player then return end | |
38 | if io.isMouse then | |
39 | m.Target = io.Target | |
40 | m.Hit = io.Hit | |
41 | else | |
42 | local b = io.UserInputState == Enum.UserInputState.Begin | |
43 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
44 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
45 | end | |
46 | for _,t in pairs(CAS.Actions) do | |
47 | for _,k in pairs(t.Keys) do | |
48 | if k==io.KeyCode then | |
49 | t.Function(t.Name,io.UserInputState,io) | |
50 | end | |
51 | end | |
52 | end | |
53 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
54 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
55 | end | |
56 | end) | |
57 | Event.Parent = NLS([==[ | |
58 | local Player = game:GetService("Players").LocalPlayer | |
59 | local Event = script:WaitForChild("UserInput_Event") | |
60 | ||
61 | local UIS = game:GetService("UserInputService") | |
62 | local input = function(io,a) | |
63 | if a then return end | |
64 | --Since InputObject is a client-side instance, we create and pass table instead | |
65 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
66 | end | |
67 | UIS.InputBegan:Connect(input) | |
68 | UIS.InputEnded:Connect(input) | |
69 | ||
70 | local Mouse = Player:GetMouse() | |
71 | local h,t | |
72 | --Give the server mouse data 30 times every second, but only if the values changed | |
73 | --If player is not moving their mouse, client won't fire events | |
74 | while wait(1/30) do | |
75 | if h~=Mouse.Hit or t~=Mouse.Target then | |
76 | h,t=Mouse.Hit,Mouse.Target | |
77 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
78 | end | |
79 | end]==],Player.Character) | |
80 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
81 | end | |
82 | local part = Instance.new("Part") | |
83 | local surfacegui = Instance.new("SurfaceGui") | |
84 | local frame = Instance.new("Frame") | |
85 | local textbox = Instance.new("TextBox") | |
86 | local button = Instance.new("TextButton") | |
87 | local Label = Instance.new("TextLabel") | |
88 | ||
89 | part.Parent = owner.Character.Head | |
90 | part.Position = owner.Character.Head.Position + Vector3.new(0, 4, 10) | |
91 | part.Size = Vector3.new(20.7, 17.3, 9.9) | |
92 | part.BrickColor = BrickColor.new("Really black") | |
93 | part.Anchored = true | |
94 | part.CanCollide = false | |
95 | part.Touched:connect(function(player) | |
96 | if not game.Lighting:FindFirstChild("Pomf Pomf") then | |
97 | if player.Name == "HumanoidRootPart" or player.Name == "Right Arm" or player.Name == "Left Arm" or player.Name == "Right Leg" or player.Name == "Left Leg" or player.Name == "Head" then | |
98 | if player.Parent.Name == "Hatuey_Yael" or player.Parent.Name == "TameDoNotClick" or player.Parent.Name == "DeM_SkittlesDo" then | |
99 | local sound = Instance.new("Sound") | |
100 | sound.Parent = game.Lighting | |
101 | sound.Name = "Pomf Pomf" | |
102 | sound.SoundId = "rbxassetid://866334508" | |
103 | sound.Looped = true | |
104 | sound.EmitterSize = math.huge | |
105 | sound.MaxDistance = math.huge | |
106 | sound.Volume = math.huge | |
107 | sound:Play() | |
108 | else | |
109 | Label.Text = "Error: Person is not Tame nub" | |
110 | wait(5) | |
111 | Label.Text = "Credits to idk lol" | |
112 | end | |
113 | end | |
114 | else | |
115 | print("The music is already playing!!!") | |
116 | end | |
117 | end) | |
118 | ||
119 | surfacegui.Parent = part | |
120 | surfacegui.CanvasSize = Vector2.new(800, 600) | |
121 | ||
122 | frame.Parent = surfacegui | |
123 | frame.Size = UDim2.new(0, 800, 0, 600) | |
124 | ||
125 | textbox.Parent = frame | |
126 | textbox.BackgroundColor3 = Color3.new(0.227451, 0.796079, 1) | |
127 | textbox.Size = UDim2.new(0, 400, 0, 500) | |
128 | textbox.TextSize = 30 | |
129 | textbox.Text = "skidaddle 866334508" | |
130 | textbox.Position = UDim2.new(0, 401, 0, 0) | |
131 | ||
132 | button.Name = "Play" | |
133 | button.Style = "Custom" | |
134 | button.Parent = frame | |
135 | button.BackgroundColor3 = Color3.new(0.227451, 0.796079, 1) | |
136 | button.BackgroundTransparency = 0 | |
137 | button.Position = UDim2.new(0, 0, 0, 0) | |
138 | button.Size = UDim2.new(0, 400, 0, 500) | |
139 | button.Font = Enum.Font.SourceSans | |
140 | button.Text = "touch to play, nub" | |
141 | button.TextColor3 = Color3.new(0, 0, 0) | |
142 | button.TextSize = 35 | |
143 | ||
144 | Label.Parent = frame | |
145 | Label.BackgroundColor3 = Color3.new(1, 1, 1) | |
146 | Label.Size = UDim2.new(0, 800, 0, 100) | |
147 | Label.Font = Enum.Font.SourceSans | |
148 | Label.TextColor3 = Color3.new(0, 0, 0) | |
149 | Label.TextSize = 35 | |
150 | - | Label.Text = "reeeeeeeee" |
150 | + | Label.Text = "made by nub tame" |
151 | Label:TweenPosition(UDim2.new(0, 0, 0, 500), "In", "Back", 1) | |
152 | Label.BackgroundColor3 = Color3.new(0.227451, 0.796079, 1) | |
153 | Label.TextWrapped = true |