SHOW:
|
|
- or go back to the newest paste.
| 1 | print("FE code by Starzozero, Thanks to him!")
| |
| 2 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 3 | local Player,game,owner = owner,game | |
| 4 | local RealPlayer = Player | |
| 5 | do | |
| 6 | print("FE Compatibility code by Mokiros, Edited by StarzoZero")
| |
| 7 | local rp = RealPlayer | |
| 8 | script.Parent = rp.Character | |
| 9 | ||
| 10 | --RemoteEvent for communicating | |
| 11 | local Event = Instance.new("RemoteEvent")
| |
| 12 | Event.Name = "UserInput_Event" | |
| 13 | ||
| 14 | --Fake event to make stuff like Mouse.KeyDown work | |
| 15 | local function fakeEvent() | |
| 16 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
| |
| 17 | t.connect = t.Connect | |
| 18 | return t | |
| 19 | end | |
| 20 | ||
| 21 | --Creating fake input objects with fake variables | |
| 22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
| |
| 23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 26 | end} | |
| 27 | --Merged 2 functions into one by checking amount of arguments | |
| 28 | CAS.UnbindAction = CAS.BindAction | |
| 29 | ||
| 30 | --This function will trigger the events that have been :Connect()'ed | |
| 31 | local function te(self,ev,...) | |
| 32 | local t = m[ev] | |
| 33 | if t and t._fakeEvent then | |
| 34 | for _,f in pairs(t.Functions) do | |
| 35 | f(...) | |
| 36 | end | |
| 37 | end | |
| 38 | end | |
| 39 | m.TrigEvent = te | |
| 40 | UIS.TrigEvent = te | |
| 41 | ||
| 42 | Event.OnServerEvent:Connect(function(plr,io) | |
| 43 | if plr~=rp then return end | |
| 44 | m.Target = io.Target | |
| 45 | m.Hit = io.Hit | |
| 46 | if not io.isMouse then | |
| 47 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 48 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 49 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 50 | end | |
| 51 | if io.UserInputType == Enum.UserInputType.MouseButton2 then | |
| 52 | return m:TrigEvent(b and "Button2Down" or "Button2Up") | |
| 53 | end | |
| 54 | for _,t in pairs(CAS.Actions) do | |
| 55 | for _,k in pairs(t.Keys) do | |
| 56 | if k==io.KeyCode then | |
| 57 | t.Function(t.Name,io.UserInputState,io) | |
| 58 | end | |
| 59 | end | |
| 60 | end | |
| 61 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 62 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 63 | end | |
| 64 | end) | |
| 65 | Event.Parent = NLS([==[ | |
| 66 | local Player = game:GetService("Players").LocalPlayer
| |
| 67 | local Event = script:WaitForChild("UserInput_Event")
| |
| 68 | local Mouse = Player:GetMouse() | |
| 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,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 74 | end | |
| 75 | UIS.InputBegan:Connect(input) | |
| 76 | UIS.InputEnded:Connect(input) | |
| 77 | local h,t | |
| 78 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 79 | --If player is not moving their mouse, client won't fire events | |
| 80 | while wait(1/30) do | |
| 81 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 82 | h,t=Mouse.Hit,Mouse.Target | |
| 83 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 84 | end | |
| 85 | end]==],Player.Character) | |
| 86 | ||
| 87 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 88 | --Real game object | |
| 89 | local _rg = game | |
| 90 | ||
| 91 | --Metatable for fake service | |
| 92 | local fsmt = {
| |
| 93 | __index = function(self,k) | |
| 94 | local s = rawget(self,"_RealService") | |
| 95 | if s then | |
| 96 | return typeof(s[k])=="function" | |
| 97 | and function(_,...)return s[k](s,...)end or s[k] | |
| 98 | end | |
| 99 | end, | |
| 100 | __newindex = function(self,k,v) | |
| 101 | local s = rawget(self,"_RealService") | |
| 102 | if s then s[k]=v end | |
| 103 | end | |
| 104 | } | |
| 105 | local function FakeService(t,RealService) | |
| 106 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 107 | return setmetatable(t,fsmt) | |
| 108 | end | |
| 109 | ||
| 110 | --Fake game object | |
| 111 | local g = {
| |
| 112 | GetService = function(self,s) | |
| 113 | return rawget(self,s) or _rg:GetService(s) | |
| 114 | end, | |
| 115 | Players = FakeService({
| |
| 116 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 117 | },"Players"), | |
| 118 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 119 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 120 | RunService = FakeService({
| |
| 121 | _btrs = {},
| |
| 122 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 123 | BindToRenderStep = function(self,name,_,fun) | |
| 124 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 125 | end, | |
| 126 | UnbindFromRenderStep = function(self,name) | |
| 127 | self._btrs[name]:Disconnect() | |
| 128 | end, | |
| 129 | },"RunService") | |
| 130 | } | |
| 131 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 132 | g.service = g.GetService | |
| 133 | FakeService(g,game) | |
| 134 | --Changing owner to fake player object to support owner:GetMouse() | |
| 135 | game,owner = g,g.Players.LocalPlayer | |
| 136 | end | |
| 137 | ||
| 138 | plr = game.Players.LocalPlayer | |
| 139 | char = plr.Character | |
| 140 | mouse = plr:GetMouse() | |
| 141 | hum = char.HumanoidRootPart | |
| 142 | root = char.Torso | |
| 143 | left = char["Left Arm"] | |
| 144 | right = char["Right Arm"] | |
| 145 | rightl = char["Right Leg"] | |
| 146 | leftl = char["Left Leg"] | |
| 147 | tors = char["Torso"] | |
| 148 | guitar = false | |
| 149 | ||
| 150 | warn("press z to start playing some sick music")
| |
| 151 | warn("press c to go sicko mode (ONLY IF PLAYING SICK MUSIC)")
| |
| 152 | warn("press x to stop")
| |
| 153 | ||
| 154 | warn("Made by Reset5017577")
| |
| 155 | char.Head.face.Texture = "rbxassetid://7131857" | |
| 156 | ||
| 157 | arm1 = Instance.new("Weld")
| |
| 158 | arm1.Parent = left | |
| 159 | arm1.Part0 = left | |
| 160 | arm1.Part1 = root | |
| 161 | arm1.C0 = CFrame.new(-0.5, 2, 0.3) | |
| 162 | arm1.C1 = CFrame.Angles(90, 0, 19.5) | |
| 163 | ||
| 164 | arm2 = Instance.new("Weld")
| |
| 165 | arm2.Parent = right | |
| 166 | arm2.Part0 = right | |
| 167 | arm2.Part1 = root | |
| 168 | arm2.C0 = CFrame.new(1.5, 1, 0.5) | |
| 169 | arm2.C1 = CFrame.Angles(20, 0, 0) | |
| 170 | ||
| 171 | MUSIK = Instance.new("Sound",tors)
| |
| 172 | MUSIK.Playing = false | |
| 173 | MUSIK.Looped = true | |
| 174 | MUSIK.Pitch = 1 | |
| 175 | - | MUSIK.SoundId = "rbxassetid://576516311" |
| 175 | + | MUSIK.SoundId = "rbxassetid://828176342" |
| 176 | MUSIK.Volume = 10 | |
| 177 | ||
| 178 | scr = Instance.new("Sound",char.Head)
| |
| 179 | scr.Playing = false | |
| 180 | scr.Looped = false | |
| 181 | - | scr.SoundId = "rbxassetid://1946318581" |
| 181 | + | scr.SoundId = "rbxassetid://828176342" |
| 182 | scr.Volume = 50 | |
| 183 | ||
| 184 | gut = Instance.new("Part")
| |
| 185 | gut.Parent = tors | |
| 186 | gut.Size = Vector3.new(2.107, 6.406, 0.412) | |
| 187 | gut.CanCollide = false | |
| 188 | ||
| 189 | gut2 = Instance.new("Part")
| |
| 190 | gut2.Parent = right | |
| 191 | gut2.Transparency = 1 | |
| 192 | gut2.Size = Vector3.new(1, 1, 1) | |
| 193 | gut2.CanCollide = false | |
| 194 | ||
| 195 | wld2 = Instance.new("Weld")
| |
| 196 | wld2.Parent = gut2 | |
| 197 | wld2.Part0 = gut2 | |
| 198 | wld2.Part1 = right | |
| 199 | wld2.C0 = CFrame.new(0, 0, 0.5) | |
| 200 | wld2.C1 = CFrame.Angles(-77, 0, 0) | |
| 201 | ||
| 202 | ParticleEmitter13 = Instance.new("ParticleEmitter")
| |
| 203 | ParticleEmitter13.Parent = gut2 | |
| 204 | ParticleEmitter13.LightInfluence = 1 | |
| 205 | ParticleEmitter13.Rate = 100 | |
| 206 | ParticleEmitter13.Texture = "http://www.roblox.com/asset/?id=0" | |
| 207 | ParticleEmitter13.Lifetime = NumberRange.new(0, 1) | |
| 208 | ||
| 209 | gutm = Instance.new("SpecialMesh",gut)
| |
| 210 | gutm.MeshId = "rbxassetid://431952393" | |
| 211 | gutm.TextureId = "rbxassetid://431952396" | |
| 212 | gutm.Scale = Vector3.new(0.15, 0.15, 0.15) | |
| 213 | ||
| 214 | wld = Instance.new("Weld",owner.Character)
| |
| 215 | wld.Parent = gut | |
| 216 | wld.Part0 = gut | |
| 217 | wld.Part1 = root | |
| 218 | wld.C0 = CFrame.new(0, 0,-2) | |
| 219 | wld.C1 = CFrame.Angles(0, 9.5, 20) | |
| 220 | ||
| 221 | function dragon() | |
| 222 | guitar = true | |
| 223 | MUSIK:Play() | |
| 224 | ParticleEmitter13.Texture = "http://www.roblox.com/asset/?id=0" | |
| 225 | ||
| 226 | while guitar do | |
| 227 | wait(0.1) | |
| 228 | arm2.C0 = CFrame.new(1.5, 1.3, 0.5) | |
| 229 | wait(0.1) | |
| 230 | arm2.C0 = CFrame.new(1.5, 1, 0.5) | |
| 231 | end | |
| 232 | end | |
| 233 | ||
| 234 | function stop() | |
| 235 | MUSIK:Stop() | |
| 236 | scr:Stop() | |
| 237 | MUSIK.Volume = 10 | |
| 238 | MUSIK.Pitch = 1 | |
| 239 | guitar = false | |
| 240 | ParticleEmitter13.Texture = "http://www.roblox.com/asset/?id=0" | |
| 241 | char.Head.face.Texture = "rbxassetid://7131857" | |
| 242 | arm2.C0 = CFrame.new(1.5, 1, 0.5) | |
| 243 | end | |
| 244 | ||
| 245 | function help() | |
| 246 | guitar = true | |
| 247 | MUSIK:Play() | |
| 248 | - | MUSIK.Volume = 5 |
| 248 | + | |
| 249 | - | MUSIK.Pitch = 1.5 |
| 249 | + | |
| 250 | MUSIK.Pitch = 1 | |
| 251 | ParticleEmitter13.Texture = "http://www.roblox.com/asset/?id=1068091086" | |
| 252 | char.Head.face.Texture = "rbxassetid://1614905466" | |
| 253 | ||
| 254 | while guitar do | |
| 255 | wait() | |
| 256 | arm2.C0 = CFrame.new(1.5, 1.3, 0.5) | |
| 257 | wait() | |
| 258 | arm2.C0 = CFrame.new(1.5, 1, 0.5) | |
| 259 | end | |
| 260 | end | |
| 261 | ||
| 262 | ||
| 263 | - | mouse.KeyUp:connect(function(Press) |
| 263 | + | |
| 264 | mouse.KeyDown:connect(function(Press) | |
| 265 | - | if Press =="z" and guitar == false then |
| 265 | + | |
| 266 | if Press == "z" and guitar == false then | |
| 267 | dragon() | |
| 268 | end | |
| 269 | if Press=="x" and guitar == true then | |
| 270 | stop() | |
| 271 | end | |
| 272 | if Press=="c" and guitar == true then | |
| 273 | help() | |
| 274 | end | |
| 275 | end) |