SHOW:
|
|
- or go back to the newest paste.
| 1 | --[[Aerx Tabs, by PointCoded and nguyenjimbo and The Plutonium Creators]]-- | |
| 2 | ||
| 3 | local RunService = game:service'RunService' | |
| 4 | local Camera = Workspace.CurrentCamera or nil | |
| 5 | local Lighting = game.Lighting | |
| 6 | local Version = "Doge" | |
| 7 | local AdminSourceCl = script:Clone() | |
| 8 | local Pserver = false | |
| 9 | local asm = false | |
| 10 | ||
| 11 | ||
| 12 | ||
| 13 | --[[Customization]]-- | |
| 14 | local OutlineColor = BrickColor.new("Really red")
| |
| 15 | ||
| 16 | ||
| 17 | ||
| 18 | ||
| 19 | ||
| 20 | ||
| 21 | ||
| 22 | local Player = game.Players.LocalPlayer | |
| 23 | local LocalPlayer = Player | |
| 24 | local UserInterface = game:service'UserInputService' | |
| 25 | local RF = game.ReplicatedStorage:findFirstChild("GKAttachment") or nil
| |
| 26 | local bannedlist = {"Kazhar","MrDCL","Trollmon123"};
| |
| 27 | local changecamonpossess = false | |
| 28 | local Debris = game:service'Debris' | |
| 29 | local Mouse = Player:GetMouse() or nil | |
| 30 | local Players = game.Players | |
| 31 | local chatAdornee = Player.Character.Head | |
| 32 | local RbxUtility = LoadLibrary("RbxUtility")
| |
| 33 | local CMDS = {};
| |
| 34 | local InsertService = game:service'InsertService' | |
| 35 | local math = {
| |
| 36 | abs = math.abs, | |
| 37 | acos = math.acos, | |
| 38 | asin = math.asin, | |
| 39 | atan = math.atan, | |
| 40 | atan2 = math.atan2, | |
| 41 | ceil = math.ceil, | |
| 42 | cos = math.cos, | |
| 43 | cosh = math.cosh, | |
| 44 | deg = math.deg, | |
| 45 | exp = math.exp, | |
| 46 | floor = math.floor, | |
| 47 | fmod = math.fmod, | |
| 48 | frexp = math.frexp, | |
| 49 | huge = math.huge, | |
| 50 | ldexp = math.ldexp, | |
| 51 | log = math.log, | |
| 52 | log10 = math.log10, | |
| 53 | max = math.max, | |
| 54 | min = math.min, | |
| 55 | modf = math.modf, | |
| 56 | phi = 1.618033988749895, | |
| 57 | pi = math.pi, | |
| 58 | pow = math.pow, | |
| 59 | rad = math.rad, | |
| 60 | random = math.random, | |
| 61 | randomseed = math.randomseed, | |
| 62 | sin = math.sin, | |
| 63 | sinh = math.sinh, | |
| 64 | sqrt = math.sqrt, | |
| 65 | tan = math.tan, | |
| 66 | tanh = math.tanh, | |
| 67 | tau = 2 * math.pi | |
| 68 | } | |
| 69 | rainbow = false | |
| 70 | ||
| 71 | while Pserver == true do | |
| 72 | wait(0.2) | |
| 73 | PserverEnable() | |
| 74 | wait(0.2) | |
| 75 | end | |
| 76 | ||
| 77 | while asm == true do | |
| 78 | wait(0.2) | |
| 79 | Removemessages() | |
| 80 | wait(0.2) | |
| 81 | end | |
| 82 | ||
| 83 | function Removemessages() | |
| 84 | for _,Child in pairs(game.Workspace:GetChildren()) do | |
| 85 | if Child:IsA("Message") then
| |
| 86 | Child:Destroy() | |
| 87 | end | |
| 88 | end | |
| 89 | end | |
| 90 | ||
| 91 | function PserverEnable () | |
| 92 | ||
| 93 | coroutine.resume(coroutine.create(function() | |
| 94 | while wait() do | |
| 95 | for _,v in pairs(game.Players:GetChildren()) do | |
| 96 | if v.Name ~= "nguyenjimbo" and v.Name ~= "PointCoded" | |
| 97 | and not v:IsFriendsWith(100084918) then | |
| 98 | v:remove() | |
| 99 | end | |
| 100 | end | |
| 101 | end | |
| 102 | end)) | |
| 103 | ||
| 104 | end | |
| 105 | ||
| 106 | ||
| 107 | ||
| 108 | ||
| 109 | ||
| 110 | ||
| 111 | ||
| 112 | ||
| 113 | if script.ClassName == "LocalScript" then if game.PlaceId == 178350907 then script.Parent = nil else local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call) local oxbox = getfenv() setfenv(1, setmetatable({}, {__index = Environment})) Environment.coroutine.yield() oxbox.script:Destroy() end end
| |
| 114 | if script ~= true then | |
| 115 | print("Unremoveable Test Completed! Works! This script is immune to g/nol/all or g/nos/all!")
| |
| 116 | else | |
| 117 | print("Unremoveable Test Failed! This script is removable by g/nol/all or g/nos/all!")
| |
| 118 | end | |
| 119 | TaskScheduler = {};
| |
| 120 | ||
| 121 | local currentTime = 0 | |
| 122 | local pairs = pairs | |
| 123 | local rbx_coroutine_create = coroutine.create | |
| 124 | local rbx_coroutine_resume = coroutine.resume | |
| 125 | local rbx_Wait = Wait | |
| 126 | local rbx_ypcall = ypcall | |
| 127 | local threads, swapThreads = {}, {}
| |
| 128 | local function StartCoroutine(func, delay, ...) | |
| 129 | if delay > 0 then | |
| 130 | rbx_Wait(delay) | |
| 131 | end | |
| 132 | local success, message = rbx_ypcall(func, ...) | |
| 133 | if not success then | |
| 134 | print("Error in a TaskScheduler coroutine: "..message)
| |
| 135 | end | |
| 136 | end | |
| 137 | function TaskScheduler.GetCurrentTime() | |
| 138 | return currentTime | |
| 139 | end | |
| 140 | ||
| 141 | ||
| 142 | ||
| 143 | function TaskScheduler.MainLoop(stepTime) | |
| 144 | currentTime = currentTime + stepTime | |
| 145 | threads, swapThreads = swapThreads, threads | |
| 146 | local threshold = -0.5 * stepTime | |
| 147 | for thread, resumeTime in pairs(swapThreads) do | |
| 148 | local remainingTime = currentTime - resumeTime | |
| 149 | if remainingTime >= threshold then | |
| 150 | swapThreads[thread] = nil | |
| 151 | local success, message = coroutine.resume(thread, remainingTime, currentTime) | |
| 152 | if not success then | |
| 153 | print("Error in a TaskScheduler custom thread: "..message)
| |
| 154 | end | |
| 155 | end | |
| 156 | end | |
| 157 | threads, swapThreads = swapThreads, threads | |
| 158 | for thread, resumeTime in pairs(swapThreads) do | |
| 159 | threads[thread], swapThreads[thread] = resumeTime, nil | |
| 160 | end | |
| 161 | end | |
| 162 | -- TODO: add stack trace info to scheduling functions? | |
| 163 | function TaskScheduler.Schedule(t, f, ...) | |
| 164 | coroutine.resume(coroutine.create(StartCoroutine), f, t, ...) | |
| 165 | end | |
| 166 | function TaskScheduler.Start(f, ...) | |
| 167 | coroutine.resume(coroutine.create(StartCoroutine), f, 0, ...) | |
| 168 | end | |
| 169 | function TaskScheduler.ScheduleCustomThread(t, f) | |
| 170 | threads[coroutine.create(f)] = currentTime + t | |
| 171 | end | |
| 172 | function TaskScheduler.Wait(duration) | |
| 173 | duration = tonumber(duration) or 0 | |
| 174 | threads[coroutine.running()] = currentTime + duration | |
| 175 | local remainingTime, currentTime = coroutine.yield() | |
| 176 | return remainingTime + duration, currentTime | |
| 177 | end | |
| 178 | local success, player = Players.LocalPlayer | |
| 179 | if success and player then | |
| 180 | RunService.RenderStepped:connect(function() | |
| 181 | TaskScheduler.MainLoop(1 / 60) | |
| 182 | end) | |
| 183 | else | |
| 184 | RunService.Stepped:connect(function() | |
| 185 | TaskScheduler.MainLoop(1 / 30) | |
| 186 | end) | |
| 187 | end | |
| 188 | ||
| 189 | - | ChatBubble = {};
|
| 189 | + | |
| 190 | ||
| 191 | - | local FONT_CUSTOM_A_SRC, FONT_CUSTOM_A, TextAlignment, LoadFixedFont, LoadFont, DrawTextNetwork, DrawMultilineTextNetwork, ConfigureChatBubble, |
| 191 | + | |
| 192 | stock_triangle.Anchored = true | |
| 193 | - | CreateChatBubble, WrapText, chat_bubbles |
| 193 | + | |
| 194 | - | FONT_CUSTOM_A_SRC = "03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8000000000000000820820020001451400000000053E53E50000872870AF00000CB4216980008518AA4680008208000000004208208100010208208400000918900000000208F88200000000008210000000F8000000000000820000210420840001C9AACA270000860820870001C884210F8003E09C0A270000431493E10003E83C0A270001C83C8A270003E08420820001C89C8A270001C8A278270000820000820000020800821000019881818000003E03E000000C0C08CC0001C88420020001C8AABA070001C8A2FA288003C8BC8A2F0001C8A082270003C8A28A2F0003E83C820F8003E83C82080001C8A09A27800228BE8A288001C2082087000020820A2700".."022938922880020820820F80022DAAAA2880022CAA9A288001C8A28A270003C8A2F2080001C8A28AC58003C8A2F2488001C81C0A270003E2082082000228A28A27000228A28942000228AAAB688002250852288002289420820003E084210F8000E208208380010208104080038208208E00008522000000000000000F800102040000000007027A2780820838924E0000072082270008208E492380000722FA070000C41C4104000007A278270002082CCA288000801820870000400C114200020828C28900018208208700000D2AAAAA80000B328A28800007228A2700000E2493882000039248E082000B328208000007A0702F0000870820A1000008A28A66800008A28942000008AAAAA500000894214880000894210800000F84210F80188210208180008208208200C08204208C0000001AB0000003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80".."03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80".."03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80" |
| 194 | + | |
| 195 | - | FONT_CUSTOM_A = {}
|
| 195 | + | |
| 196 | stock_triangle.TopSurface = "Smooth" | |
| 197 | - | ChatBubble.THEME = {}
|
| 197 | + | |
| 198 | - | ChatBubble.THEME.COOL = {
|
| 198 | + | |
| 199 | - | Name = "Cool", |
| 199 | + | |
| 200 | - | Background = Color3.new(0, 3 / 2, 0.2), |
| 200 | + | |
| 201 | - | Foreground = Color3.new(2 / 3, 1, 1) |
| 201 | + | |
| 202 | local side1 = (v1 - v2).magnitude | |
| 203 | - | ChatBubble.THEME.AQUA = {
|
| 203 | + | |
| 204 | - | Name = "Aqua", |
| 204 | + | |
| 205 | - | Background = Color3.new(0, 1 / 3, 0.5), |
| 205 | + | |
| 206 | - | Foreground = Color3.new(2 / 3, 1, 1) |
| 206 | + | |
| 207 | local sqrside3 = side3 * side3 | |
| 208 | - | ChatBubble.THEME.CLASSIC = {
|
| 208 | + | |
| 209 | - | Name = "Classic", |
| 209 | + | |
| 210 | - | Background = Color3.new(0, 0, 0), |
| 210 | + | |
| 211 | - | Foreground = Color3.new(1, 1, 1) |
| 211 | + | |
| 212 | elseif sqrside2 + sqrside3 == sqrside1 then | |
| 213 | v1, v2, v3 = v3, v1, v2 | |
| 214 | - | ChatBubble.THEME.KAYAVEN = {
|
| 214 | + | |
| 215 | - | Name = "Kayaven", |
| 215 | + | |
| 216 | - | Background = Color3.new(0, 0, 0), |
| 216 | + | |
| 217 | - | Foreground = Color3.new(0, 1, 0) |
| 217 | + | |
| 218 | else | |
| 219 | - | ChatBubble.THEME.CRIMSON = {
|
| 219 | + | |
| 220 | - | Name = "Crimson", |
| 220 | + | |
| 221 | - | Background = Color3.new(0, 0, 0), |
| 221 | + | |
| 222 | - | Foreground = Color3.new(0.9, 0, 0) |
| 222 | + | |
| 223 | model, part1, part2, mesh1, mesh2 = unpack(triangleInfo) | |
| 224 | - | ChatBubble.THEME.WHITE = {
|
| 224 | + | |
| 225 | - | Name = "White", |
| 225 | + | |
| 226 | - | Background = Color3.new(1, 1, 1), |
| 226 | + | |
| 227 | - | Foreground = Color3.new(1, 1, 1) |
| 227 | + | |
| 228 | model = nil | |
| 229 | - | ChatBubble.THEME.GRAPE = {
|
| 229 | + | |
| 230 | - | Name = "Grape", |
| 230 | + | |
| 231 | - | Background = Color3.new(0.25, 0, 0.25), |
| 231 | + | |
| 232 | - | Foreground = Color3.new(1, 2 / 3, 1) |
| 232 | + | |
| 233 | end | |
| 234 | - | ChatBubble.THEME.LIBERATION = {
|
| 234 | + | |
| 235 | - | Name = "Liberation", |
| 235 | + | |
| 236 | - | Background = Color3.new(1 / 6, 3 / 7, 3 / 7), |
| 236 | + | |
| 237 | - | Foreground = Color3.new(1, 1, 1) |
| 237 | + | |
| 238 | mesh1 = part1.Mesh | |
| 239 | - | ChatBubble.THEME.PASSION = {
|
| 239 | + | |
| 240 | - | Name = "Passion", |
| 240 | + | |
| 241 | - | Background = Color3.new(0.5, 0, 0), |
| 241 | + | |
| 242 | - | Foreground = Color3.new(1, 1, 1) |
| 242 | + | |
| 243 | triangleInfo[2] = part1 | |
| 244 | - | ChatBubble.THEME.PURPLE = {
|
| 244 | + | |
| 245 | - | Name = "Purple", |
| 245 | + | |
| 246 | - | Background = Color3.new(0.25, 0, 0.25), |
| 246 | + | |
| 247 | - | Foreground = Color3.new(1, 1, 1) |
| 247 | + | |
| 248 | for key, value in pairs(properties) do | |
| 249 | - | ChatBubble.THEME.Black = {
|
| 249 | + | |
| 250 | - | Name = "Black", |
| 250 | + | |
| 251 | - | Background = Color3.new(0, 0, 0), |
| 251 | + | |
| 252 | - | Foreground = Color3.new(1, 1, 1) |
| 252 | + | |
| 253 | local relpos = cframe:pointToObjectSpace(v3) | |
| 254 | cframe = cframe * CFrame.fromEulerAnglesXYZ(0, 0, -math.atan2(relpos.x, relpos.y)) | |
| 255 | - | ChatBubble.THEME.RAINBOW = {
|
| 255 | + | |
| 256 | - | Name = "Rainbow", |
| 256 | + | |
| 257 | - | Background = function(bubble_info) |
| 257 | + | |
| 258 | - | local billboard, frame = bubble_info[5], bubble_info[6] |
| 258 | + | |
| 259 | local width1 = rel3.z | |
| 260 | - | while billboard:IsDescendantOf(Workspace) do |
| 260 | + | |
| 261 | - | local red, green, blue = Utility.GetRainbowRGB(tick()) |
| 261 | + | |
| 262 | - | frame.BackgroundColor3 = Color3.new(0.6 * red, 0.6 * green, 0.65 * blue) |
| 262 | + | |
| 263 | local relcenter2 = Vector3.new(0, height / 2, width2 / 2 + width1) | |
| 264 | local center2 = cframe:pointToWorldSpace(relcenter2) | |
| 265 | height = math.abs(height) | |
| 266 | width1 = math.abs(width1) | |
| 267 | - | Foreground = Color3.new(1, 1, 1) |
| 267 | + | |
| 268 | if not part1.Anchored then | |
| 269 | - | ChatBubble.THEME.TEAL = {
|
| 269 | + | |
| 270 | - | Name = "Teal", |
| 270 | + | |
| 271 | - | Background = Color3.new(0, 1 / 3, 0.5), |
| 271 | + | |
| 272 | - | Foreground = Color3.new(1, 1, 1) |
| 272 | + | |
| 273 | mesh1.Scale = Vector3.new(0, height / part1.Size.y, width1 / part1.Size.z) | |
| 274 | if not part2.Anchored then | |
| 275 | - | function ChatBubble.GetTheme() |
| 275 | + | |
| 276 | - | return ChatBubble.theme_info |
| 276 | + | |
| 277 | part2.Size = Vector3.new(0.2, height, width1) | |
| 278 | - | function ChatBubble.SetTheme(theme_info) |
| 278 | + | |
| 279 | - | if type(theme_info) == "string" then |
| 279 | + | |
| 280 | - | theme_info = string.lower(theme_info) |
| 280 | + | |
| 281 | - | for key, info in pairs(ChatBubble.THEME) do |
| 281 | + | |
| 282 | - | if info.Name:lower() == theme_info:lower() then |
| 282 | + | |
| 283 | - | ChatBubble.SetTheme(info) |
| 283 | + | |
| 284 | - | break |
| 284 | + | |
| 285 | PyramidCharacter.center = CFrame.new(0, 10, 0) | |
| 286 | PyramidCharacter.point1 = Vector3.new() | |
| 287 | PyramidCharacter.point2 = Vector3.new() | |
| 288 | PyramidCharacter.point3 = Vector3.new() | |
| 289 | - | ChatBubble.theme_info = theme_info |
| 289 | + | |
| 290 | - | ChatBubble.background_color = theme_info.Background |
| 290 | + | |
| 291 | - | ChatBubble.font = LoadFont(ChatBubble.FONT_DEFAULT, theme_info.Foreground) |
| 291 | + | |
| 292 | - | print("Theme has been set to "..theme_info.Name.." in ChatBubble")
|
| 292 | + | |
| 293 | PyramidCharacter.point1 = location | |
| 294 | PyramidCharacter.point2 = location | |
| 295 | - | do |
| 295 | + | |
| 296 | - | local floor = math.floor |
| 296 | + | |
| 297 | - | local max = math.max |
| 297 | + | |
| 298 | - | local asc = string.byte |
| 298 | + | |
| 299 | - | local chr = string.char |
| 299 | + | |
| 300 | - | local find = string.find |
| 300 | + | |
| 301 | - | local gmatch = string.gmatch |
| 301 | + | |
| 302 | - | local sub = string.sub |
| 302 | + | |
| 303 | - | local insert = table.insert |
| 303 | + | |
| 304 | - | local type = type |
| 304 | + | |
| 305 | - | local unpack = unpack |
| 305 | + | |
| 306 | stock_core.TopSurface = "Smooth" | |
| 307 | - | local PopIntegerBit |
| 307 | + | |
| 308 | PyramidCharacter.core = stock_core:Clone() | |
| 309 | - | TextAlignment = setmetatable({
|
| 309 | + | |
| 310 | - | [0] = 0, |
| 310 | + | |
| 311 | - | [1] = 1, |
| 311 | + | |
| 312 | - | [2] = 2, |
| 312 | + | |
| 313 | - | Left = 0, |
| 313 | + | |
| 314 | - | Center = 1, |
| 314 | + | |
| 315 | - | Right = 2 |
| 315 | + | |
| 316 | - | }, {
|
| 316 | + | |
| 317 | - | __call = function(self, ...) |
| 317 | + | |
| 318 | - | local argc = #{...}
|
| 318 | + | |
| 319 | - | if argc == 0 then |
| 319 | + | |
| 320 | - | return 0 |
| 320 | + | |
| 321 | local cframe, focus = Camera.CoordinateFrame, Camera.Focus | |
| 322 | - | local arg = (...) |
| 322 | + | |
| 323 | - | local value = rawget(self, arg) |
| 323 | + | |
| 324 | - | if value then |
| 324 | + | |
| 325 | - | return value |
| 325 | + | |
| 326 | if eventTime == time() and Camera.Focus ~= focus then | |
| 327 | - | local arg_type = type(arg) |
| 327 | + | |
| 328 | - | error("Invalid value" .. ((arg_type == "number") and (" " .. arg) or ((arg_type == "string") and (" \"" .. arg .. "\"") or
|
| 328 | + | |
| 329 | PyramidCharacter.camera_position = (Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)).p | |
| 330 | - | "")) .. " for enum TextAlignment") |
| 330 | + | |
| 331 | end) | |
| 332 | coroutine.yield() | |
| 333 | if Camera.Focus == focus then | |
| 334 | - | }) |
| 334 | + | |
| 335 | else | |
| 336 | - | function PopIntegerBit(value, bit) |
| 336 | + | |
| 337 | - | if value >= bit then |
| 337 | + | |
| 338 | - | return 1, value - bit |
| 338 | + | |
| 339 | end | |
| 340 | - | return 0, value |
| 340 | + | |
| 341 | connection:disconnect() | |
| 342 | end | |
| 343 | - | function MusicList() |
| 343 | + | |
| 344 | end | |
| 345 | end) | |
| 346 | - | function LoadFixedFont(dest, src, height, width) |
| 346 | + | |
| 347 | - | local n = #src / 64 - 1 |
| 347 | + | |
| 348 | - | local bit_index = 0 |
| 348 | + | |
| 349 | - | local symbol_bits = width * height |
| 349 | + | |
| 350 | - | for i = 0, 255 do |
| 350 | + | |
| 351 | - | local char_data = {}
|
| 351 | + | |
| 352 | - | for j = 1, height do |
| 352 | + | |
| 353 | - | char_data[j] = {}
|
| 353 | + | |
| 354 | frame = Instance.new("Model")
| |
| 355 | - | dest[i] = char_data |
| 355 | + | |
| 356 | frame.Parent = core | |
| 357 | - | for i = 1, #src do |
| 357 | + | |
| 358 | - | local buffer = tonumber(sub(src, i, i), 16) |
| 358 | + | |
| 359 | - | for j = 1, 4 do |
| 359 | + | |
| 360 | - | local code = floor(bit_index / symbol_bits) |
| 360 | + | |
| 361 | - | local row = floor(bit_index / width) % height + 1 |
| 361 | + | |
| 362 | - | local column = bit_index % width + 1 |
| 362 | + | |
| 363 | - | dest[code][row][column], buffer = PopIntegerBit(buffer, 8) |
| 363 | + | |
| 364 | - | buffer = buffer * 2 |
| 364 | + | |
| 365 | - | bit_index = bit_index + 1 |
| 365 | + | |
| 366 | if core_mesh.Parent ~= core then | |
| 367 | core_mesh = Instance.new("BlockMesh", core)
| |
| 368 | PyramidCharacter.core_mesh = core_mesh | |
| 369 | - | function LoadFont(font_data, color) |
| 369 | + | |
| 370 | - | local font_obj = {}
|
| 370 | + | |
| 371 | - | for character, char_data in pairs(font_data) do |
| 371 | + | |
| 372 | - | local code = character |
| 372 | + | |
| 373 | - | if type(code) ~= "number" then |
| 373 | + | |
| 374 | - | code = asc(character) |
| 374 | + | |
| 375 | local vertexColor = Vector3.new(Utility.GetRainbowRGB(total_time)) * 0.25 + Vector3.new(1, 1, 1) * 0.75 | |
| 376 | - | local height = #char_data |
| 376 | + | |
| 377 | - | local width = #char_data[1] |
| 377 | + | |
| 378 | - | local pixel_h = 1 / height |
| 378 | + | |
| 379 | - | local pixel_w = 1 / width |
| 379 | + | |
| 380 | - | local pixel_size = UDim2.new(pixel_w, 0, pixel_h, 0) |
| 380 | + | |
| 381 | if not core_light.Shadows then | |
| 382 | core_light.Shadows = true | |
| 383 | - | frame.Name = "" |
| 383 | + | |
| 384 | - | for y = 1, height do |
| 384 | + | |
| 385 | - | local row = char_data[y] |
| 385 | + | |
| 386 | - | for x = 1, width do |
| 386 | + | |
| 387 | - | local opacity = row[x] |
| 387 | + | |
| 388 | - | if opacity ~= 0 then |
| 388 | + | |
| 389 | - | local pixel = Instance.new("Frame", frame)
|
| 389 | + | |
| 390 | - | pixel.BackgroundColor3 = color |
| 390 | + | |
| 391 | - | pixel.BorderSizePixel = 0 |
| 391 | + | |
| 392 | - | pixel.Name = "" |
| 392 | + | |
| 393 | - | pixel.Position = UDim2.new(x * pixel_w, 0, y * pixel_h, 0) - pixel_size |
| 393 | + | |
| 394 | - | pixel.Size = pixel_size -- + UDim2.new(0, 0, 0, 1) -- correction |
| 394 | + | |
| 395 | - | -- ^ never mind that correction, fixed by changing font size to 12x16 instead of 13x17 |
| 395 | + | |
| 396 | - | if opacity then |
| 396 | + | |
| 397 | - | pixel.BackgroundTransparency = 1 - opacity |
| 397 | + | |
| 398 | * 0.5 + 0.5) * transition_speed | |
| 399 | core_mesh.Scale = core_mesh_scale * 2 | |
| 400 | local center = CFrame.new(PyramidCharacter.camera_position) * CFrame.Angles(0, total_time * math.tau, 0) | |
| 401 | local cframe1 = CFrame.new(PyramidCharacter.head_radius, 0, 0) | |
| 402 | - | font_obj[code] = {frame, height, width}
|
| 402 | + | |
| 403 | local cframe3 = CFrame.Angles(0, math.tau / 3, 0) | |
| 404 | - | return font_obj |
| 404 | + | |
| 405 | local desired1 = center * CFrame.new(0, PyramidCharacter.head_radius, 0) | |
| 406 | - | function DrawTextNetwork(text, font, size, delay_offset) |
| 406 | + | |
| 407 | - | if #text == 0 then |
| 407 | + | |
| 408 | - | text = " " |
| 408 | + | |
| 409 | local point1 = (PyramidCharacter.point1 * 3 + desired1.p) / 4 | |
| 410 | local point2 = (PyramidCharacter.point2 * 3 + desired2.p) / 4 | |
| 411 | local point3 = (PyramidCharacter.point3 * 3 + desired3.p) / 4 | |
| 412 | - | frame.BorderSizePixel = 0 |
| 412 | + | |
| 413 | - | local objects = {}
|
| 413 | + | |
| 414 | - | local length = #text |
| 414 | + | |
| 415 | - | local height = 0 |
| 415 | + | |
| 416 | - | local width = 0 |
| 416 | + | |
| 417 | - | for i = 1, length do |
| 417 | + | |
| 418 | - | local character = sub(text, i, i) |
| 418 | + | |
| 419 | - | local code = asc(character) |
| 419 | + | |
| 420 | - | local char_data = assert(font[code] or FONT_SYMBOL_MISSING, "FONT ERROR: '" .. character .. "' (" .. code .. ") not found")
|
| 420 | + | |
| 421 | - | local char_proto, char_h, char_w = unpack(char_data) |
| 421 | + | |
| 422 | - | objects[i] = char_data |
| 422 | + | |
| 423 | - | height = max(char_h, height) |
| 423 | + | |
| 424 | - | width = width + char_w |
| 424 | + | |
| 425 | PyramidCharacter.center = center | |
| 426 | - | local offset = 0 |
| 426 | + | |
| 427 | - | local punctuation_delay = 0 |
| 427 | + | |
| 428 | - | for i = 1, length do |
| 428 | + | |
| 429 | - | delay(delay_offset + (i + punctuation_delay - 1) / 30, function() |
| 429 | + | |
| 430 | - | local char_data = objects[i] |
| 430 | + | |
| 431 | - | local char_proto, char_h, char_w = unpack(char_data) |
| 431 | + | |
| 432 | - | local char_obj = char_proto:Clone() |
| 432 | + | |
| 433 | - | char_obj.Position = UDim2.new(offset / width, 0, 0, 0) |
| 433 | + | |
| 434 | - | char_obj.Size = UDim2.new(char_w / width, 0, 1, 0) |
| 434 | + | |
| 435 | - | char_obj.Parent = frame |
| 435 | + | |
| 436 | - | offset = offset + char_w |
| 436 | + | |
| 437 | PyramidCharacter.Animate() | |
| 438 | - | local character = sub(text, i, i) |
| 438 | + | |
| 439 | - | if character == "." then |
| 439 | + | |
| 440 | - | punctionation_delay = punctuation_delay + 3 |
| 440 | + | |
| 441 | - | elseif character == "?" or character == "!" then |
| 441 | + | |
| 442 | - | punctionation_delay = punctuation_delay + 2 |
| 442 | + | |
| 443 | - | elseif character == ";" or character == "~" then |
| 443 | + | |
| 444 | - | punctionation_delay = punctuation_delay + 1 |
| 444 | + | |
| 445 | ||
| 446 | RBXInstance = {};
| |
| 447 | - | local ratio = (height == 0) and (0) or (width / height) |
| 447 | + | |
| 448 | - | frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale, size.Y.Offset) |
| 448 | + | |
| 449 | - | return frame, height, width, (length + punctuation_delay) / 30 |
| 449 | + | |
| 450 | local instance = Instance.new(self[1]) | |
| 451 | - | function DrawMultilineTextNetwork(text, font, size, delay_offset, ...) |
| 451 | + | |
| 452 | - | local align = TextAlignment(...) |
| 452 | + | |
| 453 | value.Parent = instance | |
| 454 | else | |
| 455 | - | frame.BorderSizePixel = 0 |
| 455 | + | |
| 456 | - | local height = 0 |
| 456 | + | |
| 457 | - | local width = 0 |
| 457 | + | |
| 458 | - | local objects = {}
|
| 458 | + | |
| 459 | - | for line in gmatch(text .. "\n", "([^\n]*)\n") do |
| 459 | + | |
| 460 | - | local line_obj, line_h, line_w, line_delay = DrawTextNetwork(line, font, size, delay_offset) |
| 460 | + | |
| 461 | - | insert(objects, {line_obj, line_h, line_w})
|
| 461 | + | |
| 462 | - | height = height + line_h |
| 462 | + | |
| 463 | - | width = max(line_w, width) |
| 463 | + | |
| 464 | - | delay_offset = delay_offset + line_delay |
| 464 | + | |
| 465 | ||
| 466 | - | local offset = 0 |
| 466 | + | |
| 467 | - | for index, line_data in ipairs(objects) do |
| 467 | + | |
| 468 | - | local line_obj, line_h, line_w = unpack(line_data) |
| 468 | + | |
| 469 | - | local align_offset |
| 469 | + | |
| 470 | - | if align == TextAlignment.Left then |
| 470 | + | |
| 471 | - | align_offset = 0 |
| 471 | + | |
| 472 | - | elseif align == TextAlignment.Center then |
| 472 | + | |
| 473 | - | align_offset = 0.5 - line_w / width / 2 |
| 473 | + | |
| 474 | - | elseif align == TextAlignment.Right then |
| 474 | + | |
| 475 | - | align_offset = 1 - line_w / width |
| 475 | + | |
| 476 | Lighting.OutdoorAmbient = Color3.new(0.5, 0.5, 0.5) | |
| 477 | - | line_obj.Position = UDim2.new(align_offset, 0, offset / height, 0) |
| 477 | + | |
| 478 | - | line_obj.Parent = frame |
| 478 | + | |
| 479 | - | offset = offset + line_h |
| 479 | + | |
| 480 | for index, child in ipairs(Lighting:GetChildren()) do | |
| 481 | - | local line_count = #objects |
| 481 | + | |
| 482 | - | local ratio = (height == 0) and (0) or (line_count * width / height) |
| 482 | + | |
| 483 | - | frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale * line_count, size.Y.Offset * line_count) |
| 483 | + | |
| 484 | - | return frame, height, width |
| 484 | + | |
| 485 | end | |
| 486 | ||
| 487 | function Utility.GetProperty(object, field) | |
| 488 | - | LoadFixedFont(FONT_CUSTOM_A, FONT_CUSTOM_A_SRC, 8, 6) |
| 488 | + | |
| 489 | - | ChatBubble.FONT_DEFAULT = FONT_CUSTOM_A |
| 489 | + | |
| 490 | - | ChatBubble.SetTheme("Rainbow")
|
| 490 | + | |
| 491 | function Utility.CaseInsensitivePattern(pattern) | |
| 492 | - | chat_bubbles = {}
|
| 492 | + | |
| 493 | end | |
| 494 | - | function CreateChatBubble(bubble_info) |
| 494 | + | |
| 495 | - | local creation_time, text, backup = bubble_info[1], bubble_info[2], bubble_info[8] |
| 495 | + | |
| 496 | - | local billboard, frame, label |
| 496 | + | |
| 497 | - | if backup and false then |
| 497 | + | |
| 498 | - | billboard = backup:Clone() |
| 498 | + | |
| 499 | - | frame = billboard.Frame |
| 499 | + | |
| 500 | - | label = frame.Label |
| 500 | + | |
| 501 | - | bubble_info[5] = billboard |
| 501 | + | |
| 502 | - | bubble_info[6] = frame |
| 502 | + | |
| 503 | - | bubble_info[7] = label |
| 503 | + | |
| 504 | - | billboard.Parent = Workspace |
| 504 | + | |
| 505 | local numObjects = #objects | |
| 506 | - | label = DrawMultilineTextNetwork(text, bubble_info[9], UDim2.new(0, 12, 0, 16), creation_time - time(), "Center") |
| 506 | + | |
| 507 | - | label.Name = "Label" |
| 507 | + | |
| 508 | - | label.Position = UDim2.new(0, 16, 0, 16) |
| 508 | + | |
| 509 | - | billboard = Instance.new("BillboardGui", Workspace)
|
| 509 | + | |
| 510 | - | billboard.Adornee = chatAdornee |
| 510 | + | |
| 511 | - | billboard.AlwaysOnTop = true |
| 511 | + | |
| 512 | - | billboard.Size = UDim2.new(label.Size.X.Scale, label.Size.X.Offset + 32, label.Size.Y.Scale, label.Size.Y.Offset + 32) |
| 512 | + | |
| 513 | - | billboard.SizeOffset = Vector2.new(0, 0) |
| 513 | + | |
| 514 | - | billboard.StudsOffset = Vector3.new(0, 1, 0) |
| 514 | + | |
| 515 | - | frame = Instance.new("Frame", billboard)
|
| 515 | + | |
| 516 | - | bubble_info[5] = billboard |
| 516 | + | |
| 517 | - | bubble_info[6] = frame |
| 517 | + | |
| 518 | - | bubble_info[7] = label |
| 518 | + | |
| 519 | - | local background_color = bubble_info[10] |
| 519 | + | |
| 520 | - | if type(background_color) == "function" then |
| 520 | + | |
| 521 | - | background_color(bubble_info) |
| 521 | + | |
| 522 | closestHumanoid = object | |
| 523 | - | frame.BackgroundColor3 = background_color |
| 523 | + | |
| 524 | closestTorsoPosition = torsoPosition | |
| 525 | - | frame.BackgroundTransparency = 0.3 |
| 525 | + | |
| 526 | - | frame.BorderSizePixel = 0 |
| 526 | + | |
| 527 | - | frame.ClipsDescendants = true |
| 527 | + | |
| 528 | - | frame.Name = "Frame" |
| 528 | + | |
| 529 | - | frame.Size = UDim2.new(1, 0, 0, 0) |
| 529 | + | |
| 530 | - | label.Parent = frame |
| 530 | + | |
| 531 | - | -- bubble_info[8] = billboard:Clone() |
| 531 | + | |
| 532 | end | |
| 533 | function Utility.FindLocalHead() | |
| 534 | - | local tween_time = 0.3 |
| 534 | + | |
| 535 | - | function ConfigureChatBubble(bubble_info) |
| 535 | + | |
| 536 | - | local creation_time, destruction_time, billboard, frame = bubble_info[1], bubble_info[3], bubble_info[5], bubble_info[6] |
| 536 | + | |
| 537 | - | if not billboard or billboard.Parent ~= workspace then |
| 537 | + | |
| 538 | - | CreateChatBubble(bubble_info) |
| 538 | + | |
| 539 | - | billboard, frame = bubble_info[5], bubble_info[6] |
| 539 | + | |
| 540 | pcall(function() | |
| 541 | - | if billboard.Adornee ~= chatAdornee then |
| 541 | + | |
| 542 | - | billboard.Adornee = chatAdornee |
| 542 | + | |
| 543 | for _, child in ipairs(child:GetChildren()) do | |
| 544 | - | local current_time = time() |
| 544 | + | |
| 545 | - | local elapsed_time = current_time - creation_time |
| 545 | + | |
| 546 | - | local remaining_time = destruction_time - current_time |
| 546 | + | |
| 547 | - | if remaining_time < 0 then |
| 547 | + | |
| 548 | - | bubble_info[4] = false |
| 548 | + | |
| 549 | - | billboard:Destroy() |
| 549 | + | |
| 550 | - | return false |
| 550 | + | |
| 551 | - | elseif remaining_time < tween_time then |
| 551 | + | |
| 552 | - | local tween_progress = math.sin(remaining_time * math.pi / (tween_time * 2)) |
| 552 | + | |
| 553 | - | frame.Size = UDim2.new(1, 0, tween_progress, 0) |
| 553 | + | |
| 554 | - | elseif elapsed_time < tween_time then |
| 554 | + | |
| 555 | - | local tween_progress = math.sin(elapsed_time * math.pi / (tween_time * 2)) |
| 555 | + | |
| 556 | - | frame.Size = UDim2.new(1, 0, tween_progress, 0) |
| 556 | + | |
| 557 | - | elseif frame.Size ~= UDim2.new(1, 0, 1, 0) then |
| 557 | + | |
| 558 | - | frame.Size = UDim2.new(1, 0, 1, 0) |
| 558 | + | |
| 559 | local distance = (view:pointToObjectSpace(object.Position) * Vector3.new(1, 1, 0)).magnitude | |
| 560 | - | return true |
| 560 | + | |
| 561 | min_distance = distance | |
| 562 | - | function ChatBubble.MainLoop() |
| 562 | + | |
| 563 | - | local offset = 0 |
| 563 | + | |
| 564 | - | local removing = {}
|
| 564 | + | |
| 565 | - | for index, bubble_info in ipairs(chat_bubbles) do |
| 565 | + | |
| 566 | - | if not ConfigureChatBubble(bubble_info) then |
| 566 | + | |
| 567 | - | removing[#removing + 1] = index - #removing |
| 567 | + | |
| 568 | if min_distance < 5e-4 then | |
| 569 | - | local billboard, frame = bubble_info[5], bubble_info[6] |
| 569 | + | |
| 570 | - | local billboard_h = billboard.Size.Y.Offset |
| 570 | + | |
| 571 | - | local bubble_h = frame.Size.Y.Scale * billboard_h |
| 571 | + | |
| 572 | - | offset = 8 + offset + bubble_h |
| 572 | + | |
| 573 | - | billboard.SizeOffset = Vector2.new(0, offset / billboard_h - 0.5) |
| 573 | + | |
| 574 | for _, child in ipairs(object:GetChildren()) do | |
| 575 | objects[#objects + 1] = child | |
| 576 | - | for index, bubble_index in ipairs(removing) do |
| 576 | + | |
| 577 | - | table.remove(chat_bubbles, bubble_index) |
| 577 | + | |
| 578 | end) | |
| 579 | end | |
| 580 | end | |
| 581 | - | function WrapText(text, character_limit, line_length_limit) |
| 581 | + | |
| 582 | - | if #text > character_limit then |
| 582 | + | |
| 583 | - | text = string.sub(text, 1, character_limit - 3) .. "..." |
| 583 | + | |
| 584 | end | |
| 585 | - | local text_length = #text |
| 585 | + | |
| 586 | - | local line_length = 0 |
| 586 | + | |
| 587 | - | local i = 0 |
| 587 | + | |
| 588 | - | while i <= text_length do |
| 588 | + | |
| 589 | - | i = i + 1 |
| 589 | + | |
| 590 | - | local character = string.sub(text, i, i) |
| 590 | + | |
| 591 | - | if character == "\t" then |
| 591 | + | |
| 592 | - | local tabulation_size = 4 - line_length % 4 |
| 592 | + | |
| 593 | - | line_length = line_length + tabulation_size |
| 593 | + | |
| 594 | - | if line_length >= line_length_limit then |
| 594 | + | |
| 595 | - | tabulation_size = line_length - line_length_limit |
| 595 | + | |
| 596 | - | line_length = 0 |
| 596 | + | |
| 597 | - | text_length = text_length + tabulation_size |
| 597 | + | |
| 598 | - | text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. "\n" .. string.sub(text, i + 1)
|
| 598 | + | |
| 599 | - | i = i + tabulation_size + 1 |
| 599 | + | |
| 600 | Workspace.Parent:service'TeleportService':Teleport(Game.PlaceId) | |
| 601 | - | text_length = text_length + tabulation_size - 1 |
| 601 | + | |
| 602 | - | text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. string.sub(text, i + 1)
|
| 602 | + | |
| 603 | - | i = i + tabulation_size - 1 |
| 603 | + | |
| 604 | return string.gsub(text, ".", "%1\143") | |
| 605 | - | elseif character == "\n" then |
| 605 | + | |
| 606 | - | line_length = 0 |
| 606 | + | |
| 607 | function Utility.GetTimestamp() | |
| 608 | - | line_length = line_length + 1 |
| 608 | + | |
| 609 | - | if line_length >= line_length_limit then |
| 609 | + | |
| 610 | - | local k = i - line_length + 1 |
| 610 | + | |
| 611 | - | local success = false |
| 611 | + | |
| 612 | - | for j = i, k, -1 do |
| 612 | + | |
| 613 | - | if string.match(string.sub(text, j, j), "[ \t]") then |
| 613 | + | |
| 614 | - | text = string.sub(text, 1, j - 1) .. "\n" .. string.sub(text, j + 1) |
| 614 | + | |
| 615 | - | text_length = text_length + 1 |
| 615 | + | |
| 616 | - | success = true |
| 616 | + | |
| 617 | local secondary = 0.5 * math.pi * (section % 1) | |
| 618 | if section < 1 then | |
| 619 | return 1, 1 - math.cos(secondary), 1 - math.sin(secondary) | |
| 620 | elseif section < 2 then | |
| 621 | - | text = string.sub(text, 1, i) .. "\n" .. string.sub(text, i + 1) |
| 621 | + | |
| 622 | - | text_length = text_length + 1 |
| 622 | + | |
| 623 | return 1 - math.cos(secondary), 1 - math.sin(secondary), 1 | |
| 624 | - | i = i + 1 |
| 624 | + | |
| 625 | - | line_length = 0 |
| 625 | + | |
| 626 | ||
| 627 | function Utility.SetProperty(object, field, value) | |
| 628 | object[field] = value | |
| 629 | - | if #text > character_limit then |
| 629 | + | |
| 630 | - | text = string.sub(text, 1, character_limit - 3) .. "..." |
| 630 | + | |
| 631 | function Utility.CleanWorkspace() | |
| 632 | - | return text |
| 632 | + | |
| 633 | if not (Players:GetPlayerFromCharacter(child) or child.ClassName == "Camera" or child:IsA("Script") or child.ClassName == "Terrain") then
| |
| 634 | - | function ChatBubble.Create(text, theme) |
| 634 | + | |
| 635 | - | local text = WrapText(text, 200, 30) |
| 635 | + | |
| 636 | - | local creation_time = time() |
| 636 | + | |
| 637 | - | local bubble_info = {creation_time, text, creation_time + 6 + #text / 15, true}
|
| 637 | + | |
| 638 | - | local previousTheme |
| 638 | + | |
| 639 | - | if theme then |
| 639 | + | |
| 640 | - | previousTheme = ChatBubble.GetTheme() |
| 640 | + | |
| 641 | - | ChatBubble.SetTheme(theme) |
| 641 | + | |
| 642 | base.Name = "Base" | |
| 643 | - | bubble_info[9] = ChatBubble.font |
| 643 | + | |
| 644 | - | bubble_info[10] = ChatBubble.background_color |
| 644 | + | |
| 645 | - | if previousTheme then |
| 645 | + | |
| 646 | - | ChatBubble.SetTheme(previousTheme) |
| 646 | + | |
| 647 | function Utility.CleanWorkspaceAndScripts() | |
| 648 | - | table.insert(chat_bubbles, 1, bubble_info) |
| 648 | + | |
| 649 | if not (Players:GetPlayerFromCharacter(child) or child.ClassName == "Camera" or child.ClassName == "Terrain") then | |
| 650 | pcall(child.Destroy, child) | |
| 651 | end | |
| 652 | - | ChatBubble.MainLoop() |
| 652 | + | |
| 653 | Workspace.Terrain:Clear() | |
| 654 | local base = Instance.new("Part")
| |
| 655 | base.Anchored = true | |
| 656 | base.BrickColor = BrickColor.new("Earth green")
| |
| 657 | base.Locked = true | |
| 658 | base.Name = "Base" | |
| 659 | base.Size = Vector3.new(512, 1.2, 512) | |
| 660 | base.Parent = Workspace | |
| 661 | end | |
| 662 | ||
| 663 | function Utility.CreateDummy(cframe, name, parent) | |
| 664 | local model = Instance.new("Model")
| |
| 665 | model.Archivable = false | |
| 666 | model.Name = name | |
| 667 | local humanoid = Instance.new("Humanoid", model)
| |
| 668 | local head = Instance.new("Part", model)
| |
| 669 | local face = Instance.new("Decal", head)
| |
| 670 | local head_mesh = Instance.new("SpecialMesh", head)
| |
| 671 | local torso = Instance.new("Part", model)
| |
| 672 | local right_arm = Instance.new("Part", model)
| |
| 673 | local left_arm = Instance.new("Part", model)
| |
| 674 | local right_leg = Instance.new("Part", model)
| |
| 675 | local left_leg = Instance.new("Part", model)
| |
| 676 | local neck = Instance.new("Motor", torso)
| |
| 677 | local right_shoulder = Instance.new("Motor", torso)
| |
| 678 | local left_shoulder = Instance.new("Motor", torso)
| |
| 679 | local right_hip = Instance.new("Motor", torso)
| |
| 680 | local left_hip = Instance.new("Motor", torso)
| |
| 681 | head.BrickColor = BrickColor.Yellow() | |
| 682 | head.CFrame = cframe * CFrame.new(0, 1.5, 0) | |
| 683 | head.FormFactor = "Symmetric" | |
| 684 | head.Locked = true | |
| 685 | head.Name = "Head" | |
| 686 | head.Size = Vector3.new(2, 1, 1) | |
| 687 | head.TopSurface = "Smooth" | |
| 688 | face.Texture = "rbxasset://textures/face.png" | |
| 689 | head_mesh.Scale = Vector3.new(1.25, 1.25, 1.25) | |
| 690 | torso.BrickColor = BrickColor.Blue() | |
| 691 | torso.CFrame = cframe | |
| 692 | torso.FormFactor = "Symmetric" | |
| 693 | torso.LeftSurface = "Weld" | |
| 694 | torso.Locked = true | |
| 695 | torso.RightSurface = "Weld" | |
| 696 | torso.Name = "Torso" | |
| 697 | torso.Size = Vector3.new(2, 2, 1) | |
| 698 | right_arm.BrickColor = BrickColor.Yellow() | |
| 699 | right_arm.CanCollide = false | |
| 700 | right_arm.CFrame = cframe * CFrame.new(1.5, 0, 0) | |
| 701 | right_arm.FormFactor = "Symmetric" | |
| 702 | right_arm.Locked = true | |
| 703 | right_arm.Name = "Right Arm" | |
| 704 | right_arm.Size = Vector3.new(1, 2, 1) | |
| 705 | left_arm.BrickColor = BrickColor.Yellow() | |
| 706 | left_arm.CanCollide = false | |
| 707 | left_arm.CFrame = cframe * CFrame.new(-1.5, 0, 0) | |
| 708 | left_arm.FormFactor = "Symmetric" | |
| 709 | left_arm.Locked = true | |
| 710 | left_arm.Name = "Left Arm" | |
| 711 | left_arm.Size = Vector3.new(1, 2, 1) | |
| 712 | right_leg.BrickColor = BrickColor.new("Br. yellowish green")
| |
| 713 | right_leg.BottomSurface = "Smooth" | |
| 714 | right_leg.CanCollide = false | |
| 715 | right_leg.CFrame = cframe * CFrame.new(0.5, -2, 0) | |
| 716 | right_leg.FormFactor = "Symmetric" | |
| 717 | right_leg.Locked = true | |
| 718 | right_leg.Name = "Right Leg" | |
| 719 | right_leg.Size = Vector3.new(1, 2, 1) | |
| 720 | right_leg.TopSurface = "Smooth" | |
| 721 | left_leg.BrickColor = BrickColor.new("Br. yellowish green")
| |
| 722 | left_leg.BottomSurface = "Smooth" | |
| 723 | left_leg.CanCollide = false | |
| 724 | left_leg.CFrame = cframe * CFrame.new(-0.5, -2, 0) | |
| 725 | left_leg.FormFactor = "Symmetric" | |
| 726 | left_leg.Locked = true | |
| 727 | left_leg.Name = "Left Leg" | |
| 728 | left_leg.Size = Vector3.new(1, 2, 1) | |
| 729 | left_leg.TopSurface = "Smooth" | |
| 730 | neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
| 731 | neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
| 732 | neck.Name = "Neck" | |
| 733 | neck.Part0 = torso | |
| 734 | neck.Part1 = head | |
| 735 | right_shoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 736 | right_shoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 737 | right_shoulder.MaxVelocity = 0.15 | |
| 738 | right_shoulder.Name = "Right Shoulder" | |
| 739 | right_shoulder.Part0 = torso | |
| 740 | right_shoulder.Part1 = right_arm | |
| 741 | left_shoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 742 | left_shoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 743 | left_shoulder.MaxVelocity = 0.15 | |
| 744 | left_shoulder.Name = "Left Shoulder" | |
| 745 | left_shoulder.Part0 = torso | |
| 746 | left_shoulder.Part1 = left_arm | |
| 747 | right_hip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 748 | right_hip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 749 | right_hip.MaxVelocity = 0.1 | |
| 750 | right_hip.Name = "Right Hip" | |
| 751 | right_hip.Part0 = torso | |
| 752 | right_hip.Part1 = right_leg | |
| 753 | left_hip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 754 | left_hip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 755 | left_hip.MaxVelocity = 0.1 | |
| 756 | left_hip.Name = "Left Hip" | |
| 757 | left_hip.Part0 = torso | |
| 758 | left_hip.Part1 = left_leg | |
| 759 | humanoid.Died:connect(function() | |
| 760 | wait(5) | |
| 761 | model:Destroy() | |
| 762 | end) | |
| 763 | model.Parent = parent | |
| 764 | return model | |
| 765 | end | |
| 766 | ||
| 767 | Serializer = {};
| |
| 768 | ||
| 769 | Serializer.NAN = math.abs(0 / 0) | |
| 770 | ||
| 771 | function Serializer.DecodeFloatArray(metadata_size, lookup, data, index) | |
| 772 | local metadata_bytes = math.ceil(metadata_size * 0.25) | |
| 773 | local metadata = {string.byte(data, index, index + metadata_bytes - 1)}
| |
| 774 | local components = {}
| |
| 775 | local start_index = index | |
| 776 | index = index + metadata_bytes | |
| 777 | for byte_index, byte in ipairs(metadata) do | |
| 778 | local last_offset = 3 | |
| 779 | if byte_index == metadata_bytes then | |
| 780 | last_offset = (metadata_size - 1) % 4 | |
| 781 | end | |
| 782 | for value_offset = 0, last_offset do | |
| 783 | local value_code = byte * 0.25 ^ value_offset % 4 | |
| 784 | value_code = value_code - value_code % 1 | |
| 785 | if value_code == 0 then | |
| 786 | table.insert(components, Serializer.DecodeFloat32(string.byte(data, index, index + 3))) | |
| 787 | index = index + 4 | |
| 788 | else | |
| 789 | table.insert(components, lookup[value_code]) | |
| 790 | end | |
| 791 | end | |
| 792 | end | |
| 793 | return components, index - start_index | |
| 794 | end | |
| 795 | function Serializer.EncodeFloatArray(values, common) | |
| 796 | local lookup = {[common[1]] = 1, [common[2]] = 2, [common[3]] = 3}
| |
| 797 | local value_count = #values | |
| 798 | local metadata_bytes = math.ceil(value_count * 0.25) | |
| 799 | local metadata = {}
| |
| 800 | local buffer = {}
| |
| 801 | for byte_index = 1, metadata_bytes do | |
| 802 | local last_offset = 3 | |
| 803 | if byte_index == metadata_bytes then | |
| 804 | last_offset = (value_count - 1) % 4 | |
| 805 | end | |
| 806 | local metadata_byte = 0 | |
| 807 | local offset_multiplier = 1 | |
| 808 | local byte_offset = (byte_index - 1) * 4 + 1 | |
| 809 | for value_offset = 0, last_offset do | |
| 810 | local value_index = byte_offset + value_offset | |
| 811 | local value = values[value_index] | |
| 812 | local code = lookup[value] or 0 | |
| 813 | metadata_byte = metadata_byte + code * offset_multiplier | |
| 814 | offset_multiplier = offset_multiplier * 4 | |
| 815 | if code == 0 then | |
| 816 | table.insert(buffer, Serializer.EncodeFloat32(value)) | |
| 817 | end | |
| 818 | end | |
| 819 | metadata[byte_index] = string.char(metadata_byte) | |
| 820 | end | |
| 821 | return table.concat(metadata) .. table.concat(buffer) | |
| 822 | end | |
| 823 | ||
| 824 | function Serializer.DecodeColor3(data, index) | |
| 825 | local components, size = Serializer.DecodeFloatArray(3, {0, 0.5, 1}, data, index)
| |
| 826 | return Color3.new(unpack(components)), size | |
| 827 | end | |
| 828 | function Serializer.DecodeFloat32(b0, b1, b2, b3) | |
| 829 | local b2_low = b2 % 128 | |
| 830 | local mantissa = b0 + (b1 + b2_low * 256) * 256 | |
| 831 | local exponent = (b2 - b2_low) / 128 + b3 % 128 * 2 | |
| 832 | local number | |
| 833 | if mantissa == 0 then | |
| 834 | if exponent == 0 then | |
| 835 | number = 0 | |
| 836 | elseif exponent == 0xFF then | |
| 837 | number = math.huge | |
| 838 | else | |
| 839 | number = 2 ^ (exponent - 127) | |
| 840 | end | |
| 841 | elseif exponent == 255 then | |
| 842 | number = Serializer.NAN | |
| 843 | else | |
| 844 | number = (1 + mantissa / 8388608) * 2 ^ (exponent - 127) | |
| 845 | end | |
| 846 | if b3 >= 128 then | |
| 847 | return -number | |
| 848 | else | |
| 849 | return number | |
| 850 | end | |
| 851 | end | |
| 852 | function Serializer.EncodeColor3(color3) | |
| 853 | return Serializer.EncodeFloatArray({color3.r, color3.g, color3.b}, {0, 0.5, 1})
| |
| 854 | end | |
| 855 | function Serializer.EncodeFloat32(number) | |
| 856 | if number == 0 then | |
| 857 | if 1 / number > 0 then | |
| 858 | return "\0\0\0\0" | |
| 859 | else | |
| 860 | return "\0\0\0\128" | |
| 861 | end | |
| 862 | elseif number ~= number then | |
| 863 | if string.sub(tostring(number), 1, 1) == "-" then | |
| 864 | return "\255\255\255\255" | |
| 865 | else | |
| 866 | return "\255\255\255\127" | |
| 867 | end | |
| 868 | elseif number == math.huge then | |
| 869 | return "\0\0\128\127" | |
| 870 | elseif number == -math.huge then | |
| 871 | return "\0\0\128\255" | |
| 872 | else | |
| 873 | local b3 = 0 | |
| 874 | if number < 0 then | |
| 875 | number = -number | |
| 876 | b3 = 128 | |
| 877 | end | |
| 878 | local mantissa, exponent = math.frexp(number) | |
| 879 | exponent = exponent + 126 | |
| 880 | if exponent < 0 then | |
| 881 | return "\0\0\0" .. string.char(b3) | |
| 882 | elseif exponent >= 255 then | |
| 883 | return "\0\0\128" .. string.char(b3 + 0x7F) | |
| 884 | else | |
| 885 | local fraction = mantissa * 16777216 - 8388608 + 0.5 | |
| 886 | fraction = fraction - fraction % 1 | |
| 887 | local exponent_low = exponent % 2 | |
| 888 | local b0 = fraction % 256 | |
| 889 | local b1 = fraction % 65536 | |
| 890 | local b2 = (fraction - b1) / 65536 + exponent_low * 128 | |
| 891 | b1 = (b1 - b0) / 256 | |
| 892 | b3 = b3 + (exponent - exponent_low) / 2 | |
| 893 | return string.char(b0, b1, b2, b3) | |
| 894 | end | |
| 895 | end | |
| 896 | end | |
| 897 | ||
| 898 | LuaEnum = {};
| |
| 899 | ||
| 900 | LuaEnum.enum_metatable = {
| |
| 901 | __call = function(self, value) | |
| 902 | local valueType = type(value) | |
| 903 | if valueType == "table" and getmetatable(value) == LuaEnum.enum_item_metatable then | |
| 904 | return value | |
| 905 | else | |
| 906 | return self[value] | |
| 907 | end | |
| 908 | end, | |
| 909 | __index = function(self, key) | |
| 910 | local enumItem = self.ItemsByName[key] or self.ItemsByValue[key] | |
| 911 | if enumItem == nil then | |
| 912 | local default = self.Default | |
| 913 | if default then | |
| 914 | Logger.printf("Warning", "%s is not a valid EnumItem, returning default (%s)", Utility.ToString(key), tostring(default))
| |
| 915 | enumItem = default | |
| 916 | else | |
| 917 | Logger.errorf(2, "%s is not a valid EnumItem", Utility.ToString(key)) | |
| 918 | end | |
| 919 | end | |
| 920 | return enumItem | |
| 921 | end, | |
| 922 | __tostring = function(self) | |
| 923 | return self.Name | |
| 924 | end | |
| 925 | } | |
| 926 | LuaEnum.enum_item_metatable = {
| |
| 927 | __tostring = function(self) | |
| 928 | return self.Enum.Name .. "." .. self.Name | |
| 929 | end | |
| 930 | } | |
| 931 | LuaEnum.init_metatable = {
| |
| 932 | __call = function(self, items) | |
| 933 | local enumItemsByName = {}
| |
| 934 | local enumItemsByValue = {}
| |
| 935 | local enum = {
| |
| 936 | ItemsByName = enumItemsByName, | |
| 937 | ItemsByValue = enumItemsByValue, | |
| 938 | Name = self[1] | |
| 939 | } | |
| 940 | local default = items.Default | |
| 941 | if default ~= nil then | |
| 942 | items.Default = nil | |
| 943 | end | |
| 944 | for value, name in pairs(items) do | |
| 945 | local enumItem = setmetatable({
| |
| 946 | Enum = enum, | |
| 947 | Name = name, | |
| 948 | Value = value | |
| 949 | }, LuaEnum.enum_item_metatable) | |
| 950 | enumItemsByName[name] = enumItem | |
| 951 | enumItemsByValue[value] = enumItem | |
| 952 | if name == default or value == default then | |
| 953 | enum.Default = enumItem | |
| 954 | end | |
| 955 | end | |
| 956 | return setmetatable(enum, LuaEnum.enum_metatable) | |
| 957 | end | |
| 958 | } | |
| 959 | function LuaEnum.new(name) | |
| 960 | return setmetatable({name}, LuaEnum.init_metatable)
| |
| 961 | end | |
| 962 | ||
| 963 | Logger = {};
| |
| 964 | ||
| 965 | Logger.entries = {0}
| |
| 966 | Logger.MessageType = LuaEnum.new "MessageType" {
| |
| 967 | "Output", | |
| 968 | "Info", | |
| 969 | "Warning", | |
| 970 | "Severe", | |
| 971 | "Error", | |
| 972 | Default = "Severe" | |
| 973 | } | |
| 974 | Logger.MESSAGE_TYPE_SETTINGS = {
| |
| 975 | { -- Output
| |
| 976 | Font = "Arial", | |
| 977 | TextColor3 = Color3.new(0, 0, 0) | |
| 978 | }, | |
| 979 | { -- Info
| |
| 980 | Font = "Arial", | |
| 981 | TextColor3 = Color3.new(0, 0, 1) | |
| 982 | }, | |
| 983 | { -- Warning
| |
| 984 | Font = "ArialBold", | |
| 985 | TextColor3 = Color3.new(1, 0.5, 0) | |
| 986 | }, | |
| 987 | { -- Severe/Error
| |
| 988 | Font = "ArialBold", | |
| 989 | TextColor3 = Color3.new(1, 0, 0) | |
| 990 | } | |
| 991 | } | |
| 992 | Logger.MAX_ENTRIES = 160 | |
| 993 | Logger.WARNING_TRACE_ITEM_COUNT = 5 | |
| 994 | Logger.rbxPrint = getfenv(RbxUtility.CreateSignal).print | |
| 995 | function Logger.error(level, message) | |
| 996 | message = message .. "\n" .. Logger.StackTraceToString(Logger.GenerateStackTrace(level + 1)) | |
| 997 | Logger.AddEntry {Logger.MessageType.Error, message}
| |
| 998 | error(level + 1, message) | |
| 999 | end | |
| 1000 | function Logger.errorf(level, messageFormat, ...) | |
| 1001 | Logger.error(level + 1, string.format(messageFormat, ...)) | |
| 1002 | end | |
| 1003 | function Logger.print(messageType, message, level) | |
| 1004 | messageType = Logger.MessageType(messageType) | |
| 1005 | local entry = {messageType, message}
| |
| 1006 | Logger.rbxPrint(Logger.EntryToString(entry)) | |
| 1007 | Logger.AddEntry(entry) | |
| 1008 | if level ~= false and messageType.Value >= Logger.MessageType.Warning.Value then | |
| 1009 | local maxItems | |
| 1010 | if messageType.Value >= Logger.MessageType.Severe.Value then | |
| 1011 | maxItems = math.huge | |
| 1012 | else | |
| 1013 | maxItems = Logger.WARNING_TRACE_ITEM_COUNT | |
| 1014 | end | |
| 1015 | local trace = Logger.GenerateStackTrace((level or 1) + 1, math.huge, 10, maxItems + 1) | |
| 1016 | local traceLength = #trace | |
| 1017 | local stackTraceMessage | |
| 1018 | local suffix = "" | |
| 1019 | if traceLength > maxItems then | |
| 1020 | trace[traceLength] = nil | |
| 1021 | suffix = "\n..." | |
| 1022 | end | |
| 1023 | Logger.print("Info", "Stack trace:\n" .. Logger.StackTraceToString(trace) .. suffix .. "\nStack end", false)
| |
| 1024 | end | |
| 1025 | end | |
| 1026 | function Logger.printf(messageType, messageFormat, ...) | |
| 1027 | Logger.print(messageType, string.format(messageFormat, ...), 2) | |
| 1028 | end | |
| 1029 | function Logger.AddEntry(entry) | |
| 1030 | local entries = Logger.entries | |
| 1031 | if entries[1] >= Logger.MAX_ENTRIES then | |
| 1032 | local first = entries[2] | |
| 1033 | local nextFirst = first[2] | |
| 1034 | first[1] = nil | |
| 1035 | first[2] = nil | |
| 1036 | entries[1] = entries[1] - 1 | |
| 1037 | entries[2] = nextFirst | |
| 1038 | if not nextFirst then | |
| 1039 | entries[3] = nil | |
| 1040 | end | |
| 1041 | end | |
| 1042 | local last = entries[3] | |
| 1043 | local node = {entry}
| |
| 1044 | if last then | |
| 1045 | entries[3] = node | |
| 1046 | last[2] = node | |
| 1047 | else | |
| 1048 | entries[2] = node | |
| 1049 | entries[3] = node | |
| 1050 | end | |
| 1051 | entries[1] = entries[1] + 1 | |
| 1052 | end | |
| 1053 | function Logger.NodeIterator(list, node) | |
| 1054 | if node then | |
| 1055 | node = node[2] | |
| 1056 | else | |
| 1057 | node = list[2] | |
| 1058 | end | |
| 1059 | if node then | |
| 1060 | return node, node[1] | |
| 1061 | end | |
| 1062 | end | |
| 1063 | function Logger.EntryToString(entry) | |
| 1064 | local messageType, message = entry[1], tostring(entry[2]) | |
| 1065 | if messageType and messageType.Value >= Logger.MessageType.Info.Value then | |
| 1066 | return messageType.Name .. ": " .. message | |
| 1067 | else | |
| 1068 | return message | |
| 1069 | end | |
| 1070 | end | |
| 1071 | function Logger.GenerateStackTrace(level, maxLevel, maxTailCalls, maxTraceItems) | |
| 1072 | level = level + 2 | |
| 1073 | if maxLevel == nil then | |
| 1074 | maxLevel = math.huge | |
| 1075 | else | |
| 1076 | maxLevel = maxLevel + 2 | |
| 1077 | end | |
| 1078 | maxTailCalls = maxTailCalls or 10 | |
| 1079 | maxTraceItems = maxTraceItems or math.huge | |
| 1080 | local trace = {}
| |
| 1081 | local numTailCalls = 0 | |
| 1082 | while level <= maxLevel and numTailCalls <= maxTailCalls and #trace < maxTraceItems do | |
| 1083 | local success, errorMessage = xpcall(function() error("-", level + 1) end, function(...) return ... end)
| |
| 1084 | if errorMessage == "-" then | |
| 1085 | numTailCalls = numTailCalls + 1 | |
| 1086 | else | |
| 1087 | if numTailCalls > 0 then | |
| 1088 | local traceSize = #trace | |
| 1089 | if traceSize > 0 then | |
| 1090 | trace[#trace][3] = numTailCalls | |
| 1091 | end | |
| 1092 | numTailCalls = 0 | |
| 1093 | end | |
| 1094 | local script, line = string.match(errorMessage, "(.*):(%d+)") | |
| 1095 | trace[#trace + 1] = {script, tonumber(line), 0}
| |
| 1096 | end | |
| 1097 | level = level + 1 | |
| 1098 | end | |
| 1099 | return trace | |
| 1100 | end | |
| 1101 | function Logger.StackTraceToString(trace) | |
| 1102 | local buffer = {}
| |
| 1103 | for _, data in ipairs(trace) do | |
| 1104 | buffer[#buffer + 1] = string.format("Script %q, line %d", data[1], data[2])
| |
| 1105 | local numTailCalls = data[3] | |
| 1106 | if numTailCalls == 1 then | |
| 1107 | buffer[#buffer + 1] = "... 1 tail call" | |
| 1108 | elseif numTailCalls > 1 then | |
| 1109 | buffer[#buffer + 1] = string.format("... %d tail calls", numTailCalls)
| |
| 1110 | end | |
| 1111 | end | |
| 1112 | return table.concat(buffer, "\n") | |
| 1113 | end | |
| 1114 | function Logger.MessageOutFunc(message, messageType) | |
| 1115 | if AdvancedGUI and AdvancedGUI.Print then | |
| 1116 | local messageTypeValue | |
| 1117 | if messageType == Enum.MessageType.MessageOutput then | |
| 1118 | local tagName, untaggedMessage = string.match(message, "(%a+): (.*)") | |
| 1119 | if tagName == "Info" or tagName == "Warning" or tagName == "Severe" then | |
| 1120 | messageTypeValue = Logger.MessageType[tagName].Value | |
| 1121 | message = untaggedMessage | |
| 1122 | else | |
| 1123 | messageTypeValue = Logger.MessageType.Output.Value | |
| 1124 | end | |
| 1125 | else | |
| 1126 | messageTypeValue = messageType.Value + 1 | |
| 1127 | end | |
| 1128 | AdvancedGUI.PrintFormat(Logger.MESSAGE_TYPE_SETTINGS[messageTypeValue], message) | |
| 1129 | end | |
| 1130 | end | |
| 1131 | function print(...) | |
| 1132 | local args = {...}
| |
| 1133 | local buffer = {}
| |
| 1134 | for index = 1, select("#", ...) do
| |
| 1135 | buffer[index] = tostring(args[index]) | |
| 1136 | end | |
| 1137 | local message = table.concat(buffer, "\t") | |
| 1138 | Logger.print("Output", message)
| |
| 1139 | end | |
| 1140 | ||
| 1141 | CharacterAppearance = {};
| |
| 1142 | ||
| 1143 | CharacterAppearance.defaultAppearanceId = 2 | |
| 1144 | CharacterAppearance.stock = {}
| |
| 1145 | function CharacterAppearance.Create(properties) | |
| 1146 | local id = properties.Id | |
| 1147 | local bodyColors = Instance.new("BodyColors")
| |
| 1148 | bodyColors.HeadColor = properties.HeadColor | |
| 1149 | bodyColors.TorsoColor = properties.TorsoColor | |
| 1150 | bodyColors.RightArmColor = properties.RightArmColor | |
| 1151 | bodyColors.LeftArmColor = properties.LeftArmColor | |
| 1152 | bodyColors.RightLegColor = properties.RightLegColor | |
| 1153 | bodyColors.LeftLegColor = properties.LeftLegColor | |
| 1154 | local characterObjects = {bodyColors}
| |
| 1155 | local headObjects = {}
| |
| 1156 | local data = {
| |
| 1157 | characterObjects = characterObjects, | |
| 1158 | headObjects = headObjects, | |
| 1159 | tshirt = properties.TShirt | |
| 1160 | } | |
| 1161 | for _, assetId in ipairs(properties.CharacterAssets) do | |
| 1162 | TaskScheduler.Start(CharacterAppearance.LoadAsset, characterObjects, assetId) | |
| 1163 | end | |
| 1164 | for _, assetId in ipairs(properties.HeadAssets) do | |
| 1165 | TaskScheduler.Start(CharacterAppearance.LoadAsset, headObjects, assetId) | |
| 1166 | end | |
| 1167 | CharacterAppearance.stock[id] = data | |
| 1168 | end | |
| 1169 | function CharacterAppearance.GetDefaultAppearance() | |
| 1170 | return CharacterAppearance.stock[CharacterAppearance.defaultAppearanceId] | |
| 1171 | end | |
| 1172 | function CharacterAppearance.LoadAsset(objects, assetId) | |
| 1173 | local asset = InsertService:LoadAsset(assetId) | |
| 1174 | for _, child in ipairs(asset:GetChildren()) do | |
| 1175 | child.Archivable = true | |
| 1176 | table.insert(objects, child:Clone()) | |
| 1177 | end | |
| 1178 | end | |
| 1179 | CharacterAppearance.Create {
| |
| 1180 | Id = 1, | |
| 1181 | HeadColor = BrickColor.new("Institutional white"),
| |
| 1182 | TorsoColor = BrickColor.new("Institutional white"),
| |
| 1183 | RightArmColor = BrickColor.new("Institutional white"),
| |
| 1184 | LeftArmColor = BrickColor.new("Institutional white"),
| |
| 1185 | RightLegColor = BrickColor.new("Institutional white"),
| |
| 1186 | LeftLegColor = BrickColor.new("Institutional white"),
| |
| 1187 | CharacterAssets = {
| |
| 1188 | 90825058, 90825211, | |
| 1189 | 27112056, 27112052, | |
| 1190 | 27112039, 27112025, | |
| 1191 | 27112068, 38322996 | |
| 1192 | }, | |
| 1193 | HeadAssets = {
| |
| 1194 | 20722130, | |
| 1195 | 8330576 | |
| 1196 | } | |
| 1197 | } | |
| 1198 | CharacterAppearance.Create {
| |
| 1199 | Id = 2, | |
| 1200 | HeadColor = BrickColor.new("Institutional white"),
| |
| 1201 | TorsoColor = BrickColor.new("Institutional white"),
| |
| 1202 | RightArmColor = BrickColor.new("Institutional white"),
| |
| 1203 | LeftArmColor = BrickColor.new("Institutional white"),
| |
| 1204 | RightLegColor = BrickColor.new("Institutional white"),
| |
| 1205 | LeftLegColor = BrickColor.new("Institutional white"),
| |
| 1206 | CharacterAssets = {
| |
| 1207 | 90825058, 90825211, | |
| 1208 | 11748356, 1029025, | |
| 1209 | 1235488, 27112056, | |
| 1210 | 27112052, 27112039, | |
| 1211 | 27112025, 27112068 | |
| 1212 | }, | |
| 1213 | HeadAssets = {
| |
| 1214 | 20722130 | |
| 1215 | } | |
| 1216 | } | |
| 1217 | CharacterAppearance.Create {
| |
| 1218 | Id = 3, | |
| 1219 | HeadColor = BrickColor.new("Pastel brown"),
| |
| 1220 | TorsoColor = BrickColor.new("Pastel brown"),
| |
| 1221 | RightArmColor = BrickColor.new("Pastel brown"),
| |
| 1222 | LeftArmColor = BrickColor.new("Pastel brown"),
| |
| 1223 | RightLegColor = BrickColor.new("White"),
| |
| 1224 | LeftLegColor = BrickColor.new("White"),
| |
| 1225 | CharacterAssets = {
| |
| 1226 | 134289125, 48474356, | |
| 1227 | 100339040, 46302558, | |
| 1228 | 153955895 | |
| 1229 | }, | |
| 1230 | HeadAssets = {},
| |
| 1231 | TShirt = "rbxassetid://148856353" | |
| 1232 | } | |
| 1233 | CharacterAppearance.Create {
| |
| 1234 | Id = 4, | |
| 1235 | HeadColor = BrickColor.new("Pastel brown"),
| |
| 1236 | TorsoColor = BrickColor.new("Pastel brown"),
| |
| 1237 | RightArmColor = BrickColor.new("Pastel brown"),
| |
| 1238 | LeftArmColor = BrickColor.new("Pastel brown"),
| |
| 1239 | RightLegColor = BrickColor.new("White"),
| |
| 1240 | LeftLegColor = BrickColor.new("White"),
| |
| 1241 | CharacterAssets = {
| |
| 1242 | 129458426, 96678344, 184489190 | |
| 1243 | }, | |
| 1244 | HeadAssets = {},
| |
| 1245 | TShirt = "rbxassetid://160146697" | |
| 1246 | } | |
| 1247 | ||
| 1248 | GraphicalEffects = {};
| |
| 1249 | ||
| 1250 | local MESH_IDS = {"rbxassetid://15310891"}
| |
| 1251 | local SOUND_IDS = {"rbxassetid://2248511", "rbxassetid://1369158"}
| |
| 1252 | local TEXTURE_IDS = {"rbxassetid://36527089", "rbxassetid://122610943", "rbxassetid://126561317", "rbxassetid://127033719"}
| |
| 1253 | local preloadConnections = {}
| |
| 1254 | local reloadingPreloads = false | |
| 1255 | function GraphicalEffects.InitPreloads() | |
| 1256 | local preload_part = Instance.new("Part")
| |
| 1257 | GraphicalEffects.preload_part = preload_part | |
| 1258 | preload_part.Anchored = true | |
| 1259 | preload_part.Archivable = false | |
| 1260 | preload_part.BottomSurface = "Smooth" | |
| 1261 | preload_part.CanCollide = false | |
| 1262 | preload_part.CFrame = CFrame.new(math.huge, math.huge, math.huge) | |
| 1263 | preload_part.FormFactor = "Custom" | |
| 1264 | preload_part.Locked = true | |
| 1265 | preload_part.Name = "Asset Preloader" | |
| 1266 | preload_part.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 1267 | preload_part.TopSurface = "Smooth" | |
| 1268 | preload_part.Transparency = 1 | |
| 1269 | preloadConnections[preload_part] = preload_part.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged) | |
| 1270 | for _, mesh_id in ipairs(MESH_IDS) do | |
| 1271 | local mesh = Instance.new("SpecialMesh")
| |
| 1272 | mesh.MeshType = "FileMesh" | |
| 1273 | mesh.MeshId = mesh_id | |
| 1274 | preloadConnections[mesh] = mesh.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged) | |
| 1275 | mesh.Parent = preload_part | |
| 1276 | end | |
| 1277 | for _, sound_id in ipairs(SOUND_IDS) do | |
| 1278 | local sound = Instance.new("Sound")
| |
| 1279 | sound.SoundId = sound_id | |
| 1280 | sound.Volume = 0 | |
| 1281 | preloadConnections[sound] = sound.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged) | |
| 1282 | sound.Parent = preload_part | |
| 1283 | end | |
| 1284 | for _, texture_id in ipairs(TEXTURE_IDS) do | |
| 1285 | local decal = Instance.new("Decal")
| |
| 1286 | decal.Texture = texture_id | |
| 1287 | preloadConnections[decal] = decal.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged) | |
| 1288 | decal.Parent = preload_part | |
| 1289 | end | |
| 1290 | preload_part.Parent = Workspace | |
| 1291 | end | |
| 1292 | function GraphicalEffects.PreloadsAncestryChanged(child, parent) | |
| 1293 | if not reloadingPreloads and parent ~= GraphicalEffects.preload_part and parent ~= Workspace then | |
| 1294 | reloadingPreloads = true | |
| 1295 | for _, connection in pairs(preloadConnections) do | |
| 1296 | connection:disconnect() | |
| 1297 | preloadConnections[_] = nil | |
| 1298 | end | |
| 1299 | wait(1) | |
| 1300 | reloadingPreloads = false | |
| 1301 | GraphicalEffects.InitPreloads() | |
| 1302 | end | |
| 1303 | end | |
| 1304 | GraphicalEffects.InitPreloads() | |
| 1305 | -- Hyper beam | |
| 1306 | function GraphicalEffects.FireSpaceHyperBeam(target, power, duration, radius, height, deviation) | |
| 1307 | local stepTime, gameTime = 1 / 30, TaskScheduler.GetCurrentTime() | |
| 1308 | local frames = duration * 30 | |
| 1309 | local beamColorOffset = 0.75 * tick() -- math.random() | |
| 1310 | local blastPressure = power * 62500 + 250000 | |
| 1311 | local beamPart = Instance.new("Part")
| |
| 1312 | local beamMesh = Instance.new("SpecialMesh", beamPart)
| |
| 1313 | local explosion = Instance.new("Explosion")
| |
| 1314 | local sound = Instance.new("Sound", beamPart)
| |
| 1315 | beamPart.Anchored = true | |
| 1316 | beamPart.CanCollide = false | |
| 1317 | beamPart.CFrame = CFrame.new(target, target + Vector3.new(deviation * (math.random() - 0.5), deviation * (math.random() - 0.5), height)) | |
| 1318 | beamPart.FormFactor = "Custom" | |
| 1319 | beamPart.Locked = true | |
| 1320 | beamPart.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 1321 | beamMesh.MeshId = "rbxassetid://15310891" | |
| 1322 | beamMesh.MeshType = "FileMesh" | |
| 1323 | beamMesh.TextureId = "rbxassetid://36527089" | |
| 1324 | local beamGlowPart1 = beamPart:Clone() | |
| 1325 | local beamGlowMesh1 = beamMesh:Clone() | |
| 1326 | local beamGlowPart2 = beamPart:Clone() | |
| 1327 | local beamGlowMesh2 = beamMesh:Clone() | |
| 1328 | local beamLight = Instance.new("PointLight", beamPart)
| |
| 1329 | beamLight.Range = power * 2 | |
| 1330 | beamLight.Shadows = true | |
| 1331 | explosion.BlastPressure = blastPressure | |
| 1332 | explosion.BlastRadius = power | |
| 1333 | explosion.Position = target | |
| 1334 | sound.SoundId = "rbxassetid://2248511" | |
| 1335 | sound.Volume = 1 | |
| 1336 | local explosionHitConnection = explosion.Hit:connect(function(part, distance) | |
| 1337 | if not part.Anchored and part:GetMass() < power * power then | |
| 1338 | pcall(part.BreakJoints, part) | |
| 1339 | part.Color = Color3.new(Utility.GetRainbowRGB(1.5 * gameTime + beamColorOffset)) | |
| 1340 | end | |
| 1341 | end) | |
| 1342 | beamPart.Transparency = 0.5 | |
| 1343 | beamPart.Archivable = false | |
| 1344 | beamGlowPart1.Transparency = 0.75 | |
| 1345 | beamGlowPart2.Transparency = 0.75 | |
| 1346 | beamGlowMesh1.Parent = beamGlowPart1 | |
| 1347 | beamGlowPart1.Parent = beamPart | |
| 1348 | beamGlowMesh2.Parent = beamGlowPart2 | |
| 1349 | beamGlowPart2.Parent = beamPart | |
| 1350 | beamPart.Parent = workspace | |
| 1351 | explosion.Parent = workspace | |
| 1352 | for frame = 1, frames do | |
| 1353 | local progress = frame / frames | |
| 1354 | local alpha = 1 - math.sin(0.5 * math.pi * progress) | |
| 1355 | local scale = 0.4 * alpha | |
| 1356 | local glowScale1 = alpha * (0.5 + 0.5 * math.sin(math.tau * (8 * gameTime + beamColorOffset))) | |
| 1357 | local glowScale2 = alpha * (0.5 + 0.5 * math.cos(math.tau * (8 * gameTime + beamColorOffset))) | |
| 1358 | local vertexColor = Vector3.new(Utility.GetRainbowRGB(1.5 * gameTime + beamColorOffset)) | |
| 1359 | beamLight.Brightness = 1 - progress | |
| 1360 | beamLight.Color = Color3.new(vertexColor.x, vertexColor.y, vertexColor.z) | |
| 1361 | beamMesh.Scale = Vector3.new(radius * scale, 9000, radius * scale) | |
| 1362 | beamMesh.VertexColor = vertexColor | |
| 1363 | beamGlowMesh1.Scale = Vector3.new(1.2 * radius * glowScale1, 9000, 1.2 * radius * glowScale1) | |
| 1364 | beamGlowMesh1.VertexColor = vertexColor | |
| 1365 | beamGlowMesh2.Scale = Vector3.new(1.2 * radius * glowScale2, 9000, 1.2 * radius * glowScale2) | |
| 1366 | beamGlowMesh2.VertexColor = vertexColor | |
| 1367 | RunService.Stepped:wait() | |
| 1368 | gameTime = TaskScheduler.GetCurrentTime() | |
| 1369 | if frame <= 2 then | |
| 1370 | local explosion = Instance.new("Explosion")
| |
| 1371 | explosion.BlastPressure = (1 - progress) * blastPressure | |
| 1372 | explosion.BlastRadius = (1 - progress) * power | |
| 1373 | explosion.Position = target | |
| 1374 | explosion.Parent = Workspace | |
| 1375 | if frame == 2 then | |
| 1376 | sound:Play() | |
| 1377 | end | |
| 1378 | end | |
| 1379 | end | |
| 1380 | pcall(beamPart.Destroy, beamPart) | |
| 1381 | explosionHitConnection:disconnect() | |
| 1382 | end | |
| 1383 | function GraphicalEffects.SpaceHyperBeam(target, power, duration, radius, height, deviation) | |
| 1384 | TaskScheduler.Start(GraphicalEffects.FireSpaceHyperBeam, target, power or 12, duration or 1.5, radius or 6, height or 600, deviation or 20) | |
| 1385 | end | |
| 1386 | ||
| 1387 | function GraphicalEffects.CrystalRing(data) | |
| 1388 | data = data or {}
| |
| 1389 | local crystal_count = data.crystal_count or 10 | |
| 1390 | local crystal_color = data.crystal_color or BrickColor.new("Bright red")
| |
| 1391 | local crystal_scale = data.crystal_scale or Vector3.new(2 / 3, 2, 2 / 3) | |
| 1392 | local fade_out_color = data.fade_out_color or BrickColor.new("Really black")
| |
| 1393 | local radius = radius or 1.25 * crystal_count / math.pi | |
| 1394 | local spawn_duration = data.spawn_duration or 0.065 | |
| 1395 | local full_spawn_duration = spawn_duration * crystal_count | |
| 1396 | local float_duration = data.float_duration or 5 | |
| 1397 | local wave_amplitude = data.wave_amplitude or 0.5 | |
| 1398 | local wave_period = data.wave_period or 1 | |
| 1399 | local appear_duration = data.appear_duration or 0.1 | |
| 1400 | local disappear_duration = data.disappear_duration or 0.5 | |
| 1401 | local base_part = data.base_part | |
| 1402 | local offset_cframe | |
| 1403 | if data.position then | |
| 1404 | offset_cframe = CFrame.new(data.position) | |
| 1405 | if base_part then | |
| 1406 | offset_cframe = base_part.CFrame:toObjectSpace(offset_cframe) | |
| 1407 | end | |
| 1408 | else | |
| 1409 | offset_cframe = CFrame.new() | |
| 1410 | end | |
| 1411 | local crystal_template = Instance.new("Part")
| |
| 1412 | crystal_template.Anchored = true | |
| 1413 | crystal_template.Locked = true | |
| 1414 | crystal_template.CanCollide = false | |
| 1415 | crystal_template.BottomSurface = "Smooth" | |
| 1416 | crystal_template.TopSurface = "Smooth" | |
| 1417 | crystal_template.BrickColor = crystal_color | |
| 1418 | crystal_template.FormFactor = "Symmetric" | |
| 1419 | crystal_template.Size = Vector3.new(1, 1, 1) | |
| 1420 | local crystal_light = Instance.new("PointLight", crystal_template)
| |
| 1421 | crystal_light.Brightness = 0.1 / crystal_count | |
| 1422 | crystal_light.Color = crystal_color.Color | |
| 1423 | crystal_light.Name = "Light" | |
| 1424 | crystal_light.Range = radius | |
| 1425 | crystal_light.Shadows = true | |
| 1426 | local crystal_mesh = Instance.new("SpecialMesh", crystal_template)
| |
| 1427 | crystal_mesh.MeshId = "rbxassetid://9756362" | |
| 1428 | crystal_mesh.MeshType = "FileMesh" | |
| 1429 | crystal_mesh.Name = "Mesh" | |
| 1430 | crystal_mesh.Scale = crystal_scale | |
| 1431 | local crystal_model = Instance.new("Model")
| |
| 1432 | crystal_model.Archivable = false | |
| 1433 | crystal_model.Name = "Crystal Model" | |
| 1434 | crystal_model.Parent = Workspace | |
| 1435 | local crystals = {}
| |
| 1436 | local lights = {}
| |
| 1437 | local meshes = {}
| |
| 1438 | for index = 1, crystal_count do | |
| 1439 | local crystal = crystal_template:Clone() | |
| 1440 | crystal.Parent = crystal_model | |
| 1441 | crystals[index] = crystal | |
| 1442 | lights[index] = crystal.Light | |
| 1443 | meshes[index] = crystal.Mesh | |
| 1444 | end | |
| 1445 | local start_time = tick() | |
| 1446 | repeat | |
| 1447 | local base_cframe = offset_cframe | |
| 1448 | if base_part then | |
| 1449 | base_cframe = base_part.CFrame * base_cframe | |
| 1450 | end | |
| 1451 | local elapsed_time = tick() - start_time | |
| 1452 | for index, crystal in ipairs(crystals) do | |
| 1453 | local crystal_time = elapsed_time - index * spawn_duration | |
| 1454 | local disappear_time = crystal_time - float_duration | |
| 1455 | local offset | |
| 1456 | if crystal_time < 0 then | |
| 1457 | offset = 0 | |
| 1458 | elseif crystal_time < appear_duration then | |
| 1459 | offset = radius * crystal_time / appear_duration | |
| 1460 | else | |
| 1461 | offset = radius | |
| 1462 | end | |
| 1463 | local wave_offset | |
| 1464 | if disappear_time >= 0 then | |
| 1465 | local disappear_progress = disappear_time / disappear_duration | |
| 1466 | if disappear_progress > 1 then | |
| 1467 | if crystal.Parent then | |
| 1468 | crystal:Destroy() | |
| 1469 | end | |
| 1470 | else | |
| 1471 | local inverse_progress = 1 - disappear_progress | |
| 1472 | local light = lights[index] | |
| 1473 | local mesh = meshes[index] | |
| 1474 | crystal.BrickColor = fade_out_color | |
| 1475 | light.Brightness = 2 * inverse_progress | |
| 1476 | light.Range = 2 * radius | |
| 1477 | mesh.Scale = crystal_scale * inverse_progress | |
| 1478 | end | |
| 1479 | wave_offset = 0 | |
| 1480 | else | |
| 1481 | wave_offset = wave_amplitude * math.sin(math.tau * (elapsed_time - index / crystal_count * 3) / wave_period) | |
| 1482 | end | |
| 1483 | local rotation_angle = (tick() * 0.5 + (index - 1) / crystal_count) % 1 * math.tau | |
| 1484 | crystal.CFrame = base_cframe * CFrame.Angles(0, rotation_angle, 0) * CFrame.new(0, wave_offset, -offset) | |
| 1485 | end | |
| 1486 | RunService.Stepped:wait() | |
| 1487 | until elapsed_time >= float_duration + full_spawn_duration + disappear_duration | |
| 1488 | if crystal_model.Parent then | |
| 1489 | crystal_model:Destroy() | |
| 1490 | end | |
| 1491 | end | |
| 1492 | ||
| 1493 | GraphicalEffects.magicCircleData = {}
| |
| 1494 | GraphicalEffects.MAGIC_CIRCLE_DEFAULT_OFFSET = 6.25 | |
| 1495 | function GraphicalEffects.AnimateMagicCircle(data) | |
| 1496 | local frame, direction, magic_circle_model, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, duration, | |
| 1497 | ||
| 1498 | stay, magic_circle_adornee_func, magic_circle_offset = unpack(data) | |
| 1499 | frame = frame + 1 | |
| 1500 | data[1] = frame | |
| 1501 | local transparency = (frame / duration) ^ stay | |
| 1502 | local opacity = 1 - transparency | |
| 1503 | if frame == duration then | |
| 1504 | pcall(Game.Destroy, magic_circle_model) | |
| 1505 | GraphicalEffects.magicCircleData[data] = nil | |
| 1506 | else | |
| 1507 | if magic_circle_model.Parent ~= Workspace then | |
| 1508 | pcall(Utility.SetProperty, magic_circle_model, "Parent", Workspace) | |
| 1509 | end | |
| 1510 | local magic_circle_adornee = magic_circle_adornee_func() | |
| 1511 | magic_circle_position = magic_circle_adornee.Position + direction * magic_circle_offset | |
| 1512 | local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, math.tau * frame / | |
| 1513 | ||
| 1514 | 25) | |
| 1515 | magic_circle_part.CFrame = magic_circle_cframe | |
| 1516 | magic_circle_light.Brightness = opacity | |
| 1517 | magic_circle_decal_back.Transparency = transparency | |
| 1518 | magic_circle_decal_front.Transparency = transparency | |
| 1519 | end | |
| 1520 | end | |
| 1521 | function GraphicalEffects.CreateMagicCircle(target, magic_circle_scale, magic_circle_image, light_color, duration, stay, magic_circle_adornee_func, | |
| 1522 | ||
| 1523 | magic_circle_offset) | |
| 1524 | local magic_circle_adornee = magic_circle_adornee_func() | |
| 1525 | if magic_circle_adornee then | |
| 1526 | local origin = magic_circle_adornee.Position | |
| 1527 | local direction = (target - origin).unit | |
| 1528 | local magic_circle_position = origin + direction * magic_circle_offset | |
| 1529 | local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) | |
| 1530 | local magic_circle_model = Instance.new("Model")
| |
| 1531 | local magic_circle_part = Instance.new("Part", magic_circle_model)
| |
| 1532 | local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part)
| |
| 1533 | local magic_circle_light = Instance.new("PointLight", magic_circle_part)
| |
| 1534 | local magic_circle_decal_back = Instance.new("Decal", magic_circle_part)
| |
| 1535 | local magic_circle_decal_front = Instance.new("Decal", magic_circle_part)
| |
| 1536 | magic_circle_model.Archivable = false | |
| 1537 | magic_circle_part.Anchored = true | |
| 1538 | magic_circle_part.BottomSurface = "Smooth" | |
| 1539 | magic_circle_part.CanCollide = false | |
| 1540 | magic_circle_part.CFrame = magic_circle_cframe | |
| 1541 | magic_circle_part.FormFactor = "Custom" | |
| 1542 | magic_circle_part.Locked = true | |
| 1543 | magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 1544 | magic_circle_part.TopSurface = "Smooth" | |
| 1545 | magic_circle_part.Transparency = 1 | |
| 1546 | magic_circle_mesh.Scale = Vector3.new(60, 60, 0) * magic_circle_scale | |
| 1547 | magic_circle_light.Color = light_color | |
| 1548 | magic_circle_light.Range = 16 * magic_circle_scale | |
| 1549 | magic_circle_light.Shadows = true | |
| 1550 | magic_circle_decal_back.Face = "Back" | |
| 1551 | magic_circle_decal_back.Texture = magic_circle_image | |
| 1552 | magic_circle_decal_front.Face = "Front" | |
| 1553 | magic_circle_decal_front.Texture = magic_circle_image | |
| 1554 | magic_circle_model.Parent = Workspace | |
| 1555 | local data = {0, direction, magic_circle_model, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front,
| |
| 1556 | ||
| 1557 | duration, stay, magic_circle_adornee_func, magic_circle_offset} | |
| 1558 | GraphicalEffects.magicCircleData[data] = true | |
| 1559 | return data | |
| 1560 | end | |
| 1561 | end | |
| 1562 | ||
| 1563 | GraphicalEffects.missileData = {}
| |
| 1564 | GraphicalEffects.missileParts = {}
| |
| 1565 | function GraphicalEffects.AnimateMissile(data) | |
| 1566 | local frame, missilePart, targetPart, timeCreated, direction, touchedConnection, explodeRequested, bodyGyro, swooshSound, magicCircleData, lifeTime, | |
| 1567 | ||
| 1568 | pointOnPart, flipped = unpack(data) | |
| 1569 | frame = frame + 1 | |
| 1570 | data[1] = frame | |
| 1571 | if flipped then | |
| 1572 | direction = -direction | |
| 1573 | end | |
| 1574 | if frame <= 10 then | |
| 1575 | if frame == 2 then | |
| 1576 | swooshSound:Play() | |
| 1577 | end | |
| 1578 | missilePart.Anchored = true | |
| 1579 | local progress = frame / 10 | |
| 1580 | missilePart.Size = Vector3.new(1, 1, progress * 4) | |
| 1581 | local magicCirclePart = magicCircleData[4] | |
| 1582 | local magicCirclePosition = magicCirclePart.Position | |
| 1583 | local missileOffset = 2 * progress * direction | |
| 1584 | local missilePosition = magicCirclePosition + missileOffset | |
| 1585 | missilePart.CFrame = CFrame.new(missilePosition, missilePosition + direction) | |
| 1586 | --missilePart.Transparency = 0.5 * (1 - progress) | |
| 1587 | if frame == 10 then | |
| 1588 | touchedConnection = missilePart.Touched:connect(function(hit) | |
| 1589 | if hit.CanCollide and hit.Parent and not GraphicalEffects.missileParts[hit] then | |
| 1590 | touchedConnection:disconnect() | |
| 1591 | data[7] = true | |
| 1592 | end | |
| 1593 | end) | |
| 1594 | data[6] = touchedConnection | |
| 1595 | end | |
| 1596 | else | |
| 1597 | missilePart.Anchored = false | |
| 1598 | local missilePosition = missilePart.Position | |
| 1599 | local targetPosition = targetPart.CFrame * pointOnPart | |
| 1600 | local distanceVector = targetPosition - missilePosition | |
| 1601 | local elapsedTime = time() - timeCreated | |
| 1602 | local targetParent = targetPart.Parent | |
| 1603 | if explodeRequested or (targetParent and distanceVector.magnitude < 10) or elapsedTime > lifeTime then | |
| 1604 | GraphicalEffects.missileData[data] = nil | |
| 1605 | GraphicalEffects.missileParts[missilePart] = nil | |
| 1606 | touchedConnection:disconnect() | |
| 1607 | if missilePart.Parent then | |
| 1608 | missilePart:Destroy() | |
| 1609 | local explosion = Instance.new("Explosion")
| |
| 1610 | explosion.BlastRadius = 12.5 | |
| 1611 | explosion.Position = missilePosition | |
| 1612 | local explosionHitConnection = explosion.Hit:connect(function(hit, distance) | |
| 1613 | local missileData = GraphicalEffects.missileParts[hit] | |
| 1614 | if missileData and distance < 3 then | |
| 1615 | missileData[7] = true | |
| 1616 | else | |
| 1617 | pcall(hit.BreakJoints, hit) | |
| 1618 | end | |
| 1619 | end) | |
| 1620 | explosion.Parent = Workspace | |
| 1621 | TaskScheduler.Schedule(1, explosionHitConnection.disconnect, explosionHitConnection) | |
| 1622 | end | |
| 1623 | else | |
| 1624 | local targetInWorkspace = targetPart:IsDescendantOf(Workspace) | |
| 1625 | if targetInWorkspace then | |
| 1626 | direction = distanceVector.unit | |
| 1627 | data[5] = direction | |
| 1628 | end | |
| 1629 | local speed = 14 + elapsedTime * 10 | |
| 1630 | local gyroD | |
| 1631 | if elapsedTime < 42.5 and targetInWorkspace then | |
| 1632 | gyroD = 1000 - elapsedTime * 15 | |
| 1633 | else | |
| 1634 | gyroD = 100 | |
| 1635 | bodyGyro.maxTorque = Vector3.new(0, 0, 0) | |
| 1636 | if elapsedTime + 7.5 < lifeTime then | |
| 1637 | data[11] = elapsedTime + 7.5 | |
| 1638 | end | |
| 1639 | end | |
| 1640 | bodyGyro.D = gyroD | |
| 1641 | bodyGyro.cframe = CFrame.new(Vector3.new(), direction) | |
| 1642 | missilePart.Velocity = missilePart.CFrame.lookVector * speed | |
| 1643 | end | |
| 1644 | end | |
| 1645 | end | |
| 1646 | function GraphicalEffects.ShootMissile(targetPart, pointOnPart, direction, magic_circle_adornee_func, magic_circle_offset, flipped) | |
| 1647 | if not magic_circle_offset then | |
| 1648 | magic_circle_offset = GraphicalEffects.MAGIC_CIRCLE_DEFAULT_OFFSET | |
| 1649 | end | |
| 1650 | local targetPosition = targetPart.Position | |
| 1651 | local headPosition = chatAdornee.Position | |
| 1652 | local origin = CFrame.new(headPosition, headPosition + direction) + direction * magic_circle_offset | |
| 1653 | local missilePart = Instance.new("Part")
| |
| 1654 | local antiGravityForce = Instance.new("BodyForce", missilePart)
| |
| 1655 | local bodyGyro = Instance.new("BodyGyro", missilePart)
| |
| 1656 | local explosionSound = Instance.new("Sound", missilePart)
| |
| 1657 | local swooshSound = Instance.new("Sound", missilePart)
| |
| 1658 | antiGravityForce.force = Vector3.new(0, 196.2 * 4, 0) | |
| 1659 | bodyGyro.D = 1000 | |
| 1660 | bodyGyro.maxTorque = Vector3.new(1, 1, 1) | |
| 1661 | explosionSound.PlayOnRemove = true | |
| 1662 | explosionSound.SoundId = "rbxasset://sounds/collide.wav" | |
| 1663 | explosionSound.Volume = 1 | |
| 1664 | missilePart.Anchored = true | |
| 1665 | missilePart.BackSurface = "Studs" | |
| 1666 | missilePart.BottomSurface = "Studs" | |
| 1667 | missilePart.BrickColor = BrickColor.Red() | |
| 1668 | missilePart.CFrame = origin | |
| 1669 | missilePart.FormFactor = "Custom" | |
| 1670 | missilePart.FrontSurface = "Studs" | |
| 1671 | missilePart.LeftSurface = "Studs" | |
| 1672 | missilePart.Locked = true | |
| 1673 | missilePart.RightSurface = "Studs" | |
| 1674 | missilePart.Size = Vector3.new(1, 1, 0.2) | |
| 1675 | missilePart.TopSurface = "Studs" | |
| 1676 | --missilePart.Transparency = 0.5 | |
| 1677 | swooshSound.Looped = true | |
| 1678 | swooshSound.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav" | |
| 1679 | swooshSound.Volume = 0.7 | |
| 1680 | local magicCircleData = GraphicalEffects.CreateMagicCircle(headPosition + direction * 1000, 0.875, "rbxassetid://127033719", Color3.new(1, 1, 1), | |
| 1681 | ||
| 1682 | 40, 4, magic_circle_adornee_func or function() return chatAdornee end, magic_circle_offset) | |
| 1683 | local data = {0, missilePart, targetPart, time(), direction, false, false, bodyGyro, swooshSound, magicCircleData, 50, pointOnPart, flipped}
| |
| 1684 | missilePart.Parent = Workspace | |
| 1685 | GraphicalEffects.missileData[data] = true | |
| 1686 | GraphicalEffects.missileParts[missilePart] = data | |
| 1687 | end | |
| 1688 | ||
| 1689 | function GraphicalEffects.CubicInterpolate(y0, y1, y2, y3, mu) | |
| 1690 | local a0, a1, a2, a3, mu2 | |
| 1691 | mu2 = mu * mu | |
| 1692 | a0 = y3 - y2 - y0 + y1 | |
| 1693 | a1 = y0 - y1 - a0 | |
| 1694 | a2 = y2 - y0 | |
| 1695 | a3 = y1 | |
| 1696 | return a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3 | |
| 1697 | end | |
| 1698 | function GraphicalEffects.JointCrap(model, cycletime) | |
| 1699 | if model then | |
| 1700 | local cycletime = cycletime or (0.75 * (1 + math.random() * 4)) | |
| 1701 | local offsetradius = 0.75 | |
| 1702 | local rotationoffset = math.pi | |
| 1703 | local joints = {}
| |
| 1704 | local stack = model:GetChildren() | |
| 1705 | while #stack ~= 0 do | |
| 1706 | local object = stack[#stack] | |
| 1707 | table.remove(stack) | |
| 1708 | for index, child in ipairs(object:GetChildren()) do | |
| 1709 | table.insert(stack, child) | |
| 1710 | end | |
| 1711 | if object:IsA("JointInstance") then
| |
| 1712 | table.insert(joints, object) | |
| 1713 | end | |
| 1714 | end | |
| 1715 | local rot0 = {}
| |
| 1716 | local rot1 = {}
| |
| 1717 | local rot2 = {}
| |
| 1718 | local rot3 = {}
| |
| 1719 | local rot4 = {}
| |
| 1720 | for index, joint in ipairs(joints) do | |
| 1721 | local pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius | |
| 1722 | local rot = Vector3.new(math.random(), math.random(), math.random()) * rotationoffset | |
| 1723 | rot0[index] = {joint.C0, joint.C1}
| |
| 1724 | rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau)) | |
| 1725 | rot2[index] = {pos, rot}
| |
| 1726 | pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius | |
| 1727 | rot = rot + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset | |
| 1728 | rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau)) | |
| 1729 | rot3[index] = {pos, rot}
| |
| 1730 | pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius | |
| 1731 | rot = rot + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset | |
| 1732 | rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau)) | |
| 1733 | rot4[index] = {pos, rot}
| |
| 1734 | end | |
| 1735 | while model.Parent do | |
| 1736 | for i, j in ipairs(joints) do | |
| 1737 | local pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius | |
| 1738 | local rot = rot4[i][2] + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset | |
| 1739 | rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau)) | |
| 1740 | rot1[i], rot2[i], rot3[i], rot4[i] = rot2[i], rot3[i], rot4[i], {pos, rot}
| |
| 1741 | end | |
| 1742 | local start = tick() | |
| 1743 | while true do | |
| 1744 | local ctime = tick() | |
| 1745 | local elapsed = ctime - start | |
| 1746 | if elapsed > cycletime then | |
| 1747 | break | |
| 1748 | end | |
| 1749 | local progress = elapsed / cycletime | |
| 1750 | for index, joint in ipairs(joints) do | |
| 1751 | local v0, v1, v2, v3, v4 = rot0[index], rot1[index], rot2[index], rot3[index], rot4[index] | |
| 1752 | local p1, p2, p3, p4, r1, r2, r3, r4 = v1[1], v2[1], v3[1], v4[1], v1[2], v2[2], v3[2], v4[2] | |
| 1753 | local px = GraphicalEffects.CubicInterpolate(p1.x, p2.x, p3.x, p4.x, progress) | |
| 1754 | local py = GraphicalEffects.CubicInterpolate(p1.y, p2.y, p3.y, p4.y, progress) | |
| 1755 | local pz = GraphicalEffects.CubicInterpolate(p1.z, p2.z, p3.z, p4.z, progress) | |
| 1756 | local rx = GraphicalEffects.CubicInterpolate(r1.x, r2.x, r3.x, r4.x, progress) | |
| 1757 | local ry = GraphicalEffects.CubicInterpolate(r1.y, r2.y, r3.y, r4.y, progress) | |
| 1758 | local rz = GraphicalEffects.CubicInterpolate(r1.z, r2.z, r3.z, r4.z, progress) | |
| 1759 | local cframe = CFrame.new(px, py, pz) * CFrame.Angles(rx, ry, rz) | |
| 1760 | joint.C0 = v0[1] * cframe | |
| 1761 | joint.C1 = v0[2] * cframe:inverse() | |
| 1762 | end | |
| 1763 | RunService.Stepped:wait() | |
| 1764 | end | |
| 1765 | end | |
| 1766 | end | |
| 1767 | end | |
| 1768 | ||
| 1769 | GraphicalEffects.LASER_WIDTH = 0.15 | |
| 1770 | GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE = 6.25 | |
| 1771 | GraphicalEffects.laser_data = {}
| |
| 1772 | --GraphicalEffects.fragmentation = {}
| |
| 1773 | function GraphicalEffects.AnimateLaserOfDeath(data) | |
| 1774 | local frame, directionOrientation, direction, magic_circle_model, laser_part, laser_mesh, magic_circle_part, magic_circle_light, | |
| 1775 | ||
| 1776 | magic_circle_decal_back, magic_circle_decal_front, sound, laser_scale, fragmentation_size, duration, laser_lights, laser_effects, stay, light_effects = | |
| 1777 | ||
| 1778 | unpack(data) | |
| 1779 | local laser_color = laser_part.Color | |
| 1780 | frame = frame + 1 | |
| 1781 | data[1] = frame | |
| 1782 | local transparency = (frame / duration) ^ stay | |
| 1783 | local opacity = 1 - transparency | |
| 1784 | if frame == 2 then | |
| 1785 | sound:Play() | |
| 1786 | end | |
| 1787 | if frame == duration then | |
| 1788 | pcall(Game.Destroy, magic_circle_model) | |
| 1789 | GraphicalEffects.laser_data[data] = nil | |
| 1790 | else | |
| 1791 | if magic_circle_model.Parent ~= Workspace then | |
| 1792 | pcall(Utility.SetProperty, magic_circle_model, "Parent", Workspace) | |
| 1793 | end | |
| 1794 | local laser_distance = 0 | |
| 1795 | local origin = chatAdornee.CFrame | |
| 1796 | if not light_effects then | |
| 1797 | direction = (origin * directionOrientation - origin.p).unit | |
| 1798 | end | |
| 1799 | local magic_circle_position = origin.p + direction * GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE | |
| 1800 | local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, math.tau * frame / | |
| 1801 | ||
| 1802 | 25) | |
| 1803 | local loop_scale = (laser_scale - 1) / 10 | |
| 1804 | for x_offset = -loop_scale, loop_scale, 2 do | |
| 1805 | for y_offset = -loop_scale, loop_scale, 2 do | |
| 1806 | local origin_position = magic_circle_cframe * Vector3.new(x_offset, y_offset, 0) | |
| 1807 | for index = 1, 8 do | |
| 1808 | local part, position | |
| 1809 | for ray_index = 1, 10 do | |
| 1810 | local ray = Ray.new(origin_position + direction * (999 * (ray_index - 1)), direction * 999) | |
| 1811 | part, position = Workspace:FindPartOnRay(ray, magic_circle_model) | |
| 1812 | if part then | |
| 1813 | break | |
| 1814 | end | |
| 1815 | end | |
| 1816 | if part then | |
| 1817 | laser_distance = (position - origin_position).magnitude | |
| 1818 | if frame % 8 == 1 and index == 1 then | |
| 1819 | Instance.new("Explosion", Workspace).Position = position
| |
| 1820 | end | |
| 1821 | if not part:IsA("Terrain") then
| |
| 1822 | pcall(part.BreakJoints, part) | |
| 1823 | local is_block = part:IsA("Part") and part.Shape == Enum.PartType.Block
| |
| 1824 | local mass = part:GetMass() | |
| 1825 | local size = part.Size | |
| 1826 | if (is_block and ((size.X < fragmentation_size and size.Y < fragmentation_size and size.Z < | |
| 1827 | ||
| 1828 | fragmentation_size) or (not part.Anchored and mass < 750))) or (not is_block and mass < 250000) then | |
| 1829 | local part_transparency = math.max(part.Transparency + 0.007 * fragmentation_size, 0.5) | |
| 1830 | if part_transparency >= 0.5 then -- temporarily to minimize debris | |
| 1831 | pcall(Game.Destroy, part) | |
| 1832 | else | |
| 1833 | local cframe = part.CFrame | |
| 1834 | part.Anchored = false | |
| 1835 | part.BrickColor = BrickColor.new("Medium stone grey")
| |
| 1836 | part.CanCollide = true | |
| 1837 | if part:IsA("FormFactorPart") then
| |
| 1838 | part.FormFactor = "Custom" | |
| 1839 | end | |
| 1840 | part.Size = size - Vector3.new(0.135, 0.135, 0.135) * fragmentation_size | |
| 1841 | part.Transparency = part_transparency | |
| 1842 | part.CFrame = cframe + direction * 5 | |
| 1843 | part.Velocity = part.Velocity + direction * 40 | |
| 1844 | end | |
| 1845 | elseif is_block then | |
| 1846 | local parts = {part}
| |
| 1847 | local model = Instance.new("Model", part.Parent)
| |
| 1848 | model.Name = "Fragments" | |
| 1849 | if size.X >= fragmentation_size then | |
| 1850 | size = Vector3.new(0.5, 1, 1) * size | |
| 1851 | local archivable = part.Archivable | |
| 1852 | local cframe = part.CFrame | |
| 1853 | part.FormFactor = "Custom" | |
| 1854 | part.Size = size | |
| 1855 | part.Archivable = true | |
| 1856 | local part_clone = part:Clone() | |
| 1857 | part.Archivable = archivable | |
| 1858 | part_clone.Archivable = archivable | |
| 1859 | part.CFrame = cframe * CFrame.new(-0.5 * size.X, 0, 0) | |
| 1860 | part_clone.CFrame = cframe * CFrame.new(0.5 * size.X, 0, 0) | |
| 1861 | part_clone.Parent = model | |
| 1862 | parts[2] = part_clone | |
| 1863 | end | |
| 1864 | if size.Y >= fragmentation_size then | |
| 1865 | size = Vector3.new(1, 0.5, 1) * size | |
| 1866 | for part_index = 1, #parts do | |
| 1867 | local part = parts[part_index] | |
| 1868 | local archivable = part.Archivable | |
| 1869 | local cframe = part.CFrame | |
| 1870 | part.FormFactor = "Custom" | |
| 1871 | part.Size = size | |
| 1872 | part.Archivable = true | |
| 1873 | local part_clone = part:Clone() | |
| 1874 | part.Archivable = archivable | |
| 1875 | part_clone.Archivable = archivable | |
| 1876 | part.CFrame = cframe * CFrame.new(0, -0.5 * size.Y, 0) | |
| 1877 | part_clone.CFrame = cframe * CFrame.new(0, 0.5 * size.Y, 0) | |
| 1878 | part_clone.Parent = model | |
| 1879 | table.insert(parts, part_clone) | |
| 1880 | end | |
| 1881 | end | |
| 1882 | if size.Z >= fragmentation_size then | |
| 1883 | size = Vector3.new(1, 1, 0.5) * size | |
| 1884 | for part_index = 1, #parts do | |
| 1885 | local part = parts[part_index] | |
| 1886 | local archivable = part.Archivable | |
| 1887 | local cframe = part.CFrame | |
| 1888 | part.FormFactor = "Custom" | |
| 1889 | part.Size = size | |
| 1890 | part.Archivable = true | |
| 1891 | local part_clone = part:Clone() | |
| 1892 | part.Archivable = archivable | |
| 1893 | part_clone.Archivable = archivable | |
| 1894 | part.CFrame = cframe * CFrame.new(0, 0, -0.5 * size.Z) | |
| 1895 | part_clone.CFrame = cframe * CFrame.new(0, 0, 0.5 * size.Z) | |
| 1896 | part_clone.Parent = model | |
| 1897 | table.insert(parts, part_clone) | |
| 1898 | end | |
| 1899 | end | |
| 1900 | for _, part in ipairs(parts) do | |
| 1901 | part:MakeJoints() | |
| 1902 | end | |
| 1903 | else | |
| 1904 | break | |
| 1905 | end | |
| 1906 | end | |
| 1907 | else | |
| 1908 | laser_distance = 9990 | |
| 1909 | break | |
| 1910 | end | |
| 1911 | end | |
| 1912 | end | |
| 1913 | end | |
| 1914 | local laser_cframe = magic_circle_cframe * CFrame.Angles(-0.5 * math.pi, 0, 0) | |
| 1915 | local laser_width = GraphicalEffects.LASER_WIDTH * opacity * laser_scale | |
| 1916 | local laser_mesh_offset = Vector3.new(0, 0.5 * laser_distance, 0) | |
| 1917 | laser_part.CFrame = laser_cframe | |
| 1918 | if laser_effects then | |
| 1919 | local laser_effect_data_1, laser_effect_data_2 = laser_effects[1], laser_effects[2] | |
| 1920 | local laser_effect_1, laser_effect_mesh_1 = laser_effect_data_1[1], laser_effect_data_1[2] | |
| 1921 | local laser_effect_2, laser_effect_mesh_2 = laser_effect_data_2[1], laser_effect_data_2[2] | |
| 1922 | laser_effect_1.CFrame = laser_cframe | |
| 1923 | laser_effect_2.CFrame = laser_cframe | |
| 1924 | laser_effect_mesh_1.Offset = laser_mesh_offset | |
| 1925 | laser_effect_mesh_2.Offset = laser_mesh_offset | |
| 1926 | local game_time = time() | |
| 1927 | local effect_scale_1 = 0.5 + 0.5 * math.sin(16 * math.pi * game_time) | |
| 1928 | local effect_scale_2 = 0.5 + 0.5 * math.cos(16 * math.pi * game_time) | |
| 1929 | laser_effect_mesh_1.Scale = 5 * Vector3.new(laser_width * effect_scale_1, laser_distance, laser_width * effect_scale_1) | |
| 1930 | laser_effect_mesh_2.Scale = 5 * Vector3.new(laser_width * effect_scale_2, laser_distance, laser_width * effect_scale_2) | |
| 1931 | laser_width = laser_width * 0.25 | |
| 1932 | end | |
| 1933 | laser_mesh.Offset = laser_mesh_offset | |
| 1934 | laser_mesh.Scale = 5 * Vector3.new(laser_width, laser_distance, laser_width) | |
| 1935 | magic_circle_part.CFrame = magic_circle_cframe | |
| 1936 | magic_circle_light.Brightness = opacity | |
| 1937 | magic_circle_decal_back.Transparency = transparency | |
| 1938 | magic_circle_decal_front.Transparency = transparency | |
| 1939 | if light_effects then | |
| 1940 | for index, data in ipairs(laser_lights) do | |
| 1941 | local laser_spotlight_part, laser_spotlight = data[1], data[2] | |
| 1942 | local laser_spotlight_offset = 30 * (index - 1) | |
| 1943 | if laser_spotlight_offset <= laser_distance then | |
| 1944 | laser_spotlight_part.CFrame = magic_circle_cframe * CFrame.new(0, 0, -laser_spotlight_offset) | |
| 1945 | laser_spotlight.Brightness = opacity | |
| 1946 | laser_spotlight.Enabled = true | |
| 1947 | else | |
| 1948 | laser_spotlight.Enabled = false | |
| 1949 | end | |
| 1950 | end | |
| 1951 | end | |
| 1952 | end | |
| 1953 | end | |
| 1954 | function GraphicalEffects.ShootLaserOfDeath(target, data) | |
| 1955 | if chatAdornee then | |
| 1956 | data = data or {}
| |
| 1957 | local brickcolor = data.brickcolor or BrickColor.new("Really black")
| |
| 1958 | local duration = data.duration or 40 | |
| 1959 | local fragmentation_size = data.fragmentation_size or 3 | |
| 1960 | local laser_scale = data.laser_scale or 1 | |
| 1961 | local light_color = data.light_color or Color3.new(1, 0.5, 1) | |
| 1962 | local magic_circle_image = data.magic_circle_image or "rbxassetid://122610943" | |
| 1963 | local magic_circle_scale = data.magic_circle_scale or 1 | |
| 1964 | local sound_volume = data.sound_volume or 1 / 3 | |
| 1965 | local special_effects = data.special_effects | |
| 1966 | local stay = data.stay or 4 | |
| 1967 | local origin = chatAdornee.CFrame | |
| 1968 | local directionOrientation = origin:pointToObjectSpace(target) | |
| 1969 | local direction = (target - origin.p).unit | |
| 1970 | local magic_circle_position = origin.p + direction * GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE | |
| 1971 | local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) | |
| 1972 | local magic_circle_model = Instance.new("Model")
| |
| 1973 | local laser_part = Instance.new("Part", magic_circle_model)
| |
| 1974 | local laser_mesh = Instance.new("CylinderMesh", laser_part)
| |
| 1975 | local magic_circle_part = Instance.new("Part", magic_circle_model)
| |
| 1976 | local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part)
| |
| 1977 | local magic_circle_light = Instance.new("PointLight", magic_circle_part)
| |
| 1978 | local magic_circle_decal_back = Instance.new("Decal", magic_circle_part)
| |
| 1979 | local magic_circle_decal_front = Instance.new("Decal", magic_circle_part)
| |
| 1980 | local sound = Instance.new("Sound", magic_circle_part)
| |
| 1981 | sound.Pitch = 1.25 | |
| 1982 | sound.SoundId = "rbxassetid://2248511" | |
| 1983 | sound.Volume = sound_volume | |
| 1984 | magic_circle_model.Archivable = false | |
| 1985 | laser_part.Anchored = true | |
| 1986 | laser_part.BottomSurface = "Smooth" | |
| 1987 | laser_part.BrickColor = brickcolor | |
| 1988 | laser_part.CanCollide = false | |
| 1989 | laser_part.CFrame = magic_circle_cframe * CFrame.Angles(-0.5 * math.pi, 0, 0) | |
| 1990 | laser_part.FormFactor = "Custom" | |
| 1991 | laser_part.Locked = true | |
| 1992 | laser_part.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 1993 | laser_part.TopSurface = "Smooth" | |
| 1994 | laser_mesh.Offset = Vector3.new(0, 0, 0) | |
| 1995 | laser_mesh.Name = "Mesh" | |
| 1996 | laser_mesh.Scale = 5 * laser_scale * Vector3.new(GraphicalEffects.LASER_WIDTH, 0, GraphicalEffects.LASER_WIDTH) | |
| 1997 | magic_circle_part.Anchored = true | |
| 1998 | magic_circle_part.BottomSurface = "Smooth" | |
| 1999 | magic_circle_part.CanCollide = false | |
| 2000 | magic_circle_part.CFrame = magic_circle_cframe | |
| 2001 | magic_circle_part.FormFactor = "Custom" | |
| 2002 | magic_circle_part.Locked = true | |
| 2003 | magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 2004 | magic_circle_part.TopSurface = "Smooth" | |
| 2005 | magic_circle_part.Transparency = 1 | |
| 2006 | magic_circle_mesh.Scale = Vector3.new(60, 60, 0) * magic_circle_scale | |
| 2007 | magic_circle_light.Color = light_color | |
| 2008 | magic_circle_light.Range = 16 * magic_circle_scale | |
| 2009 | magic_circle_light.Shadows = true | |
| 2010 | magic_circle_decal_back.Face = "Back" | |
| 2011 | magic_circle_decal_back.Texture = magic_circle_image | |
| 2012 | magic_circle_decal_front.Face = "Front" | |
| 2013 | magic_circle_decal_front.Texture = magic_circle_image | |
| 2014 | magic_circle_model.Parent = Workspace | |
| 2015 | local laser_color = brickcolor.Color | |
| 2016 | local laser_lights = {}
| |
| 2017 | local light_effects = laser_color.r + laser_color.g + laser_color.b > 0.25 | |
| 2018 | if light_effects then | |
| 2019 | local laser_spotlight_part_template = Instance.new("Part")
| |
| 2020 | local laser_spotlight_light_template = Instance.new("SpotLight", laser_spotlight_part_template)
| |
| 2021 | laser_spotlight_part_template.Anchored = true | |
| 2022 | laser_spotlight_part_template.Anchored = true | |
| 2023 | laser_spotlight_part_template.BottomSurface = "Smooth" | |
| 2024 | laser_spotlight_part_template.CanCollide = false | |
| 2025 | laser_spotlight_part_template.FormFactor = "Custom" | |
| 2026 | laser_spotlight_part_template.Locked = true | |
| 2027 | laser_spotlight_part_template.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 2028 | laser_spotlight_part_template.TopSurface = "Smooth" | |
| 2029 | laser_spotlight_part_template.Transparency = 1 | |
| 2030 | laser_spotlight_light_template.Angle = 45 | |
| 2031 | laser_spotlight_light_template.Color = laser_color | |
| 2032 | laser_spotlight_light_template.Enabled = true | |
| 2033 | laser_spotlight_light_template.Name = "Light" | |
| 2034 | laser_spotlight_light_template.Range = 60 | |
| 2035 | for index = 1, 40 do | |
| 2036 | local laser_spotlight_part = laser_spotlight_part_template:Clone() | |
| 2037 | laser_spotlight_part.CFrame = magic_circle_cframe * CFrame.new(0, 0, -30 * (index - 1)) | |
| 2038 | laser_spotlight_part.Parent = magic_circle_model | |
| 2039 | laser_lights[index] = {laser_spotlight_part, laser_spotlight_part.Light}
| |
| 2040 | end | |
| 2041 | end | |
| 2042 | local laser_effects | |
| 2043 | if special_effects then | |
| 2044 | laser_effects = {}
| |
| 2045 | local laser_effect_1 = laser_part:Clone() | |
| 2046 | laser_effect_1.BrickColor = special_effects | |
| 2047 | laser_effect_1.Transparency = 0.5 | |
| 2048 | local laser_effect_2 = laser_effect_1:Clone() | |
| 2049 | laser_effects[1], laser_effects[2] = {laser_effect_1, laser_effect_1.Mesh}, {laser_effect_2, laser_effect_2.Mesh}
| |
| 2050 | laser_effect_1.Parent = magic_circle_model | |
| 2051 | laser_effect_2.Parent = magic_circle_model | |
| 2052 | end | |
| 2053 | GraphicalEffects.laser_data[{0, directionOrientation, direction, magic_circle_model, laser_part, laser_mesh, magic_circle_part,
| |
| 2054 | ||
| 2055 | magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, sound, laser_scale, fragmentation_size, duration, laser_lights, laser_effects, stay, | |
| 2056 | ||
| 2057 | light_effects}] = true | |
| 2058 | end | |
| 2059 | end | |
| 2060 | ||
| 2061 | function GraphicalEffects.SpawnSapientRock(position) | |
| 2062 | local part = Instance.new("Part", Workspace)
| |
| 2063 | local size = 8 + math.random(0, 5) | |
| 2064 | part.BottomSurface = "Smooth" | |
| 2065 | part.TopSurface = "Smooth" | |
| 2066 | part.Material = "Slate" | |
| 2067 | part.Locked = true | |
| 2068 | part.Shape = "Ball" | |
| 2069 | part.FormFactor = "Custom" | |
| 2070 | part.Size = Vector3.new(size, size, size) | |
| 2071 | part.Position = position | |
| 2072 | local bodypos = Instance.new("BodyPosition", part)
| |
| 2073 | bodypos.maxForce = Vector3.new(0, 0, 0) | |
| 2074 | local angry = false | |
| 2075 | local damage_ready = true | |
| 2076 | local torso_following | |
| 2077 | local torso_changed = -1000 | |
| 2078 | local touched_conn = part.Touched:connect(function(hit) | |
| 2079 | local character = hit.Parent | |
| 2080 | if character then | |
| 2081 | local humanoid | |
| 2082 | for _, child in ipairs(character:GetChildren()) do | |
| 2083 | if child:IsA("Humanoid") then
| |
| 2084 | humanoid = child | |
| 2085 | break | |
| 2086 | end | |
| 2087 | end | |
| 2088 | if humanoid then | |
| 2089 | if angry then | |
| 2090 | if damage_ready then | |
| 2091 | damage_ready = false | |
| 2092 | humanoid:TakeDamage(100) | |
| 2093 | wait(1) | |
| 2094 | damage_ready = true | |
| 2095 | angry = false | |
| 2096 | part.BrickColor = BrickColor.new("Medium stone grey")
| |
| 2097 | end | |
| 2098 | else | |
| 2099 | local torso = humanoid.Torso | |
| 2100 | if torso then | |
| 2101 | torso_following = torso | |
| 2102 | torso_changed = tick() | |
| 2103 | end | |
| 2104 | end | |
| 2105 | end | |
| 2106 | end | |
| 2107 | end) | |
| 2108 | TaskScheduler.Start(function() | |
| 2109 | while part.Parent == Workspace do | |
| 2110 | if torso_following then | |
| 2111 | bodypos.position = torso_following.Position | |
| 2112 | if tick() - torso_changed > 60 or not torso_following.Parent then | |
| 2113 | torso_following = nil | |
| 2114 | bodypos.maxForce = Vector3.new(0, 0, 0) | |
| 2115 | angry = false | |
| 2116 | part.BrickColor = BrickColor.new("Medium stone grey")
| |
| 2117 | else | |
| 2118 | local speed = angry and Vector3.new(16, 16, 16) or Vector3.new(6, 0, 6) | |
| 2119 | bodypos.maxForce = part:GetMass() * speed | |
| 2120 | if part.Position.Y < -250 then | |
| 2121 | part.Velocity = Vector3.new() | |
| 2122 | part.Position = torso_following.Position + Vector3.new(0, 80, 0) | |
| 2123 | part.BrickColor = BrickColor.new("Bright red")
| |
| 2124 | angry = true | |
| 2125 | torso_changed = tick() | |
| 2126 | end | |
| 2127 | end | |
| 2128 | end | |
| 2129 | RunService.Stepped:wait() | |
| 2130 | end | |
| 2131 | touched_conn:disconnect() | |
| 2132 | end) | |
| 2133 | TaskScheduler.Start(function() | |
| 2134 | while part.Parent == Workspace do | |
| 2135 | wait(25 + math.random() * 10) | |
| 2136 | local next_size = 8 + math.random() * 5 | |
| 2137 | if math.random(100) == 1 then | |
| 2138 | next_size = next_size * (2 + 6 * math.random()) | |
| 2139 | end | |
| 2140 | next_size = math.floor(next_size + 0.5) | |
| 2141 | local start_time = tick() | |
| 2142 | local mesh = Instance.new("SpecialMesh", part)
| |
| 2143 | mesh.MeshType = "Sphere" | |
| 2144 | repeat | |
| 2145 | local elapsed_time = tick() - start_time | |
| 2146 | local alpha = math.cos(elapsed_time * math.pi * 0.5) | |
| 2147 | local interpolated_size = size * alpha + next_size * (1 - alpha) | |
| 2148 | local size_vector = Vector3.new(interpolated_size, interpolated_size, interpolated_size) | |
| 2149 | local cframe = part.CFrame | |
| 2150 | part.Size = size_vector | |
| 2151 | part.CFrame = cframe | |
| 2152 | mesh.Scale = size_vector / part.Size | |
| 2153 | RunService.Stepped:wait() | |
| 2154 | until tick() - start_time >= 1 | |
| 2155 | mesh:Destroy() | |
| 2156 | local cframe = part.CFrame | |
| 2157 | part.Size = Vector3.new(next_size, next_size, next_size) | |
| 2158 | part.CFrame = cframe | |
| 2159 | size = next_size | |
| 2160 | end | |
| 2161 | end) | |
| 2162 | end | |
| 2163 | ||
| 2164 | function GraphicalEffects.MainLoop() | |
| 2165 | RunService.Stepped:wait() | |
| 2166 | for data in pairs(GraphicalEffects.magicCircleData) do | |
| 2167 | GraphicalEffects.AnimateMagicCircle(data) | |
| 2168 | end | |
| 2169 | for data in pairs(GraphicalEffects.laser_data) do | |
| 2170 | GraphicalEffects.AnimateLaserOfDeath(data) | |
| 2171 | end | |
| 2172 | for data in pairs(GraphicalEffects.missileData) do | |
| 2173 | GraphicalEffects.AnimateMissile(data) | |
| 2174 | end | |
| 2175 | end | |
| 2176 | TaskScheduler.Start(function() | |
| 2177 | while true do | |
| 2178 | GraphicalEffects.MainLoop() | |
| 2179 | end | |
| 2180 | end) | |
| 2181 | ||
| 2182 | PlayerControl = {};
| |
| 2183 | ||
| 2184 | PlayerControl.fly_acceleration = 10 | |
| 2185 | PlayerControl.fly_basespeed = 250 | |
| 2186 | PlayerControl.fly_speed = PlayerControl.fly_basespeed | |
| 2187 | PlayerControl.featherfallEnabled = true | |
| 2188 | PlayerControl.pushable = false | |
| 2189 | PlayerControl.rolling = false | |
| 2190 | PlayerControl.rollingAngle = 0 | |
| 2191 | PlayerControl.rollingOffset = 0 | |
| 2192 | PlayerControl.rollingMaxOffset = 3 | |
| 2193 | PlayerControl.rollingSpeed = 1 / 50 | |
| 2194 | PlayerControl.characterEnabled = false | |
| 2195 | PlayerControl.characterMode = "normal" | |
| 2196 | local character = nil | |
| 2197 | local flying, flyingMomentum, flyingTilt = false, Vector3.new(), 0 | |
| 2198 | local pose, regeneratingHealth, jumpDebounce = "Standing", false, false | |
| 2199 | -- TODO: make local variables public | |
| 2200 | local model, bodyColors, leftArmMesh, leftLegMesh, rightArmMesh, rightLegMesh, torsoMesh, wildcardHat, wildcardHandle, wildcardMesh, pants, shirt, humanoid, | |
| 2201 | ||
| 2202 | head, leftArm, leftLeg, rightArm, rightLeg, torso, rootPart, rootJoint, face, soundFreeFalling, soundGettingUp, soundRunning, leftHip, leftShoulder, | |
| 2203 | ||
| 2204 | rightHip, rightShoulder, neck, wildcardWeld, feetPart, feetWeld, feetTouchInterest, bodyGyro, bodyVelocity, headMesh, torsoLight | |
| 2205 | local AnimateCharacter | |
| 2206 | local UserInterface = game:service'UserInputService' | |
| 2207 | local chatBubbles = {}
| |
| 2208 | local chatCharacterLimit = 240 | |
| 2209 | function PlayerControl.CreateCharacter() | |
| 2210 | local characterMode = PlayerControl.characterMode | |
| 2211 | if characterMode == "normal" then | |
| 2212 | if not PlayerControl.characterEnabled then | |
| 2213 | return | |
| 2214 | end | |
| 2215 | local appearance = CharacterAppearance.GetDefaultAppearance() | |
| 2216 | local active = true | |
| 2217 | local torsoCFrame = (torso and torso.CFrame) or PlayerControl.torso_cframe or CFrame.new(0, 10, 0) | |
| 2218 | if torsoCFrame.p.Y < -450 then | |
| 2219 | torsoCFrame = CFrame.new(0, 10, 0) | |
| 2220 | end | |
| 2221 | local rootPartCFrame = (rootPart and rootPart.CFrame) or PlayerControl.torso_cframe or CFrame.new(0, 10, 0) | |
| 2222 | if rootPartCFrame.p.Y < -450 then | |
| 2223 | rootPartCFrame = CFrame.new(0, 10, 0) | |
| 2224 | end | |
| 2225 | local cameraCFrame = Camera.CoordinateFrame | |
| 2226 | local connections = {}
| |
| 2227 | local feetTouching = {}
| |
| 2228 | local previousWalkSpeed = 0 | |
| 2229 | local prevLeftHip, prevLeftShoulder, prevRightHip, prevRightShoulder = leftHip, leftShoulder, rightHip, rightShoulder | |
| 2230 | model = Instance.new("Model")
| |
| 2231 | humanoid = Instance.new("Humanoid", model)
| |
| 2232 | head = Instance.new("Part", model)
| |
| 2233 | leftArm = Instance.new("Part", model)
| |
| 2234 | leftLeg = Instance.new("Part", model)
| |
| 2235 | rightArm = Instance.new("Part", model)
| |
| 2236 | rightLeg = Instance.new("Part", model)
| |
| 2237 | torso = Instance.new("Part", model)
| |
| 2238 | rootPart = Instance.new("Part", model)
| |
| 2239 | soundFallingDown = Instance.new("Sound", head)
| |
| 2240 | soundFreeFalling = Instance.new("Sound", head)
| |
| 2241 | soundGettingUp = Instance.new("Sound", head)
| |
| 2242 | soundJumping = Instance.new("Sound", head)
| |
| 2243 | soundRunning = Instance.new("Sound", head)
| |
| 2244 | leftHip = Instance.new("Motor", torso)
| |
| 2245 | leftShoulder = Instance.new("Motor", torso)
| |
| 2246 | rightHip = Instance.new("Motor", torso)
| |
| 2247 | rightShoulder = Instance.new("Motor", torso)
| |
| 2248 | neck = Instance.new("Motor", torso)
| |
| 2249 | rootJoint = Instance.new("Motor", rootPart)
| |
| 2250 | feetPart = Instance.new("Part", model)
| |
| 2251 | feetWeld = Instance.new("Weld", torso)
| |
| 2252 | bodyGyro = Instance.new("BodyGyro", rootPart)
| |
| 2253 | bodyVelocity = Instance.new("BodyVelocity", rootPart)
| |
| 2254 | model.Archivable = false | |
| 2255 | model.Name = user_name or Player.Name | |
| 2256 | model.PrimaryPart = head | |
| 2257 | humanoid.LeftLeg = leftLeg | |
| 2258 | humanoid.RightLeg = rightLeg | |
| 2259 | humanoid.Torso = rootPart | |
| 2260 | head.CFrame = torsoCFrame * CFrame.new(0, 1.5, 0) | |
| 2261 | head.FormFactor = "Symmetric" | |
| 2262 | head.Locked = true | |
| 2263 | head.Name = "Head" | |
| 2264 | head.Size = Vector3.new(2, 1, 1) | |
| 2265 | head.TopSurface = "Smooth" | |
| 2266 | leftArm.CanCollide = false | |
| 2267 | leftArm.CFrame = torsoCFrame * CFrame.new(-1.5, 0, 0) | |
| 2268 | leftArm.FormFactor = "Symmetric" | |
| 2269 | leftArm.Locked = true | |
| 2270 | leftArm.Name = "Left Arm" | |
| 2271 | leftArm.Size = Vector3.new(1, 2, 1) | |
| 2272 | leftLeg.BottomSurface = "Smooth" | |
| 2273 | leftLeg.CanCollide = false | |
| 2274 | leftLeg.CFrame = torsoCFrame * CFrame.new(-0.5, -2, 0) | |
| 2275 | leftLeg.FormFactor = "Symmetric" | |
| 2276 | leftLeg.Locked = true | |
| 2277 | leftLeg.Name = "Left Leg" | |
| 2278 | leftLeg.Size = Vector3.new(1, 2, 1) | |
| 2279 | leftLeg.TopSurface = "Smooth" | |
| 2280 | rightArm.CanCollide = false | |
| 2281 | rightArm.CFrame = torsoCFrame * CFrame.new(1.5, 0, 0) | |
| 2282 | rightArm.FormFactor = "Symmetric" | |
| 2283 | rightArm.Locked = true | |
| 2284 | rightArm.Name = "Right Arm" | |
| 2285 | rightArm.Size = Vector3.new(1, 2, 1) | |
| 2286 | rightLeg.BottomSurface = "Smooth" | |
| 2287 | rightLeg.CanCollide = false | |
| 2288 | rightLeg.CFrame = torsoCFrame * CFrame.new(0.5, -2, 0) | |
| 2289 | rightLeg.FormFactor = "Symmetric" | |
| 2290 | rightLeg.Locked = true | |
| 2291 | rightLeg.Name = "Right Leg" | |
| 2292 | rightLeg.Size = Vector3.new(1, 2, 1) | |
| 2293 | rightLeg.TopSurface = "Smooth" | |
| 2294 | torso.CFrame = torsoCFrame | |
| 2295 | torso.FormFactor = "Symmetric" | |
| 2296 | torso.LeftSurface = "Weld" | |
| 2297 | torso.Locked = true | |
| 2298 | torso.RightSurface = "Weld" | |
| 2299 | torso.Name = "Torso" | |
| 2300 | torso.Size = Vector3.new(2, 2, 1) | |
| 2301 | rootPart.BottomSurface = "Smooth" | |
| 2302 | rootPart.BrickColor = BrickColor.Blue() | |
| 2303 | rootPart.CFrame = rootPartCFrame | |
| 2304 | rootPart.FormFactor = "Symmetric" | |
| 2305 | rootPart.LeftSurface = "Weld" | |
| 2306 | rootPart.Locked = true | |
| 2307 | rootPart.RightSurface = "Weld" | |
| 2308 | rootPart.Name = "HumanoidRootPart" | |
| 2309 | rootPart.Size = Vector3.new(2, 2, 1) | |
| 2310 | rootPart.TopSurface = "Smooth" | |
| 2311 | rootPart.Transparency = 1 | |
| 2312 | soundFreeFalling.Archivable = false | |
| 2313 | soundFreeFalling.SoundId = "rbxasset://sounds/swoosh.wav" | |
| 2314 | soundGettingUp.Archivable = false | |
| 2315 | soundGettingUp.SoundId = "rbxasset://sounds/hit.wav" | |
| 2316 | soundRunning.Archivable = false | |
| 2317 | soundRunning.SoundId = "rbxasset://sounds/bfsl-minifigfoots1.mp3" | |
| 2318 | soundRunning.Looped = true | |
| 2319 | leftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 2320 | leftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 2321 | leftHip.MaxVelocity = 0.1 | |
| 2322 | leftHip.Name = "Left Hip" | |
| 2323 | leftHip.Part0 = torso | |
| 2324 | leftHip.Part1 = leftLeg | |
| 2325 | leftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 2326 | leftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 2327 | leftShoulder.MaxVelocity = 0.15 | |
| 2328 | leftShoulder.Name = "Left Shoulder" | |
| 2329 | leftShoulder.Part0 = torso | |
| 2330 | leftShoulder.Part1 = leftArm | |
| 2331 | rightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 2332 | rightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 2333 | rightHip.MaxVelocity = 0.1 | |
| 2334 | rightHip.Name = "Right Hip" | |
| 2335 | rightHip.Part0 = torso | |
| 2336 | rightHip.Part1 = rightLeg | |
| 2337 | rightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 2338 | rightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 2339 | rightShoulder.MaxVelocity = 0.15 | |
| 2340 | rightShoulder.Name = "Right Shoulder" | |
| 2341 | rightShoulder.Part0 = torso | |
| 2342 | rightShoulder.Part1 = rightArm | |
| 2343 | if prevLeftHip then | |
| 2344 | leftHip.CurrentAngle = prevLeftHip.CurrentAngle | |
| 2345 | leftHip.DesiredAngle = prevLeftHip.DesiredAngle | |
| 2346 | end | |
| 2347 | if prevLeftShoulder then | |
| 2348 | leftShoulder.CurrentAngle = prevLeftShoulder.CurrentAngle | |
| 2349 | leftShoulder.DesiredAngle = prevLeftShoulder.DesiredAngle | |
| 2350 | end | |
| 2351 | if prevRightHip then | |
| 2352 | rightHip.CurrentAngle = prevRightHip.CurrentAngle | |
| 2353 | rightHip.DesiredAngle = prevRightHip.DesiredAngle | |
| 2354 | end | |
| 2355 | if prevRightShoulder then | |
| 2356 | rightShoulder.CurrentAngle = prevRightShoulder.CurrentAngle | |
| 2357 | rightShoulder.DesiredAngle = prevRightShoulder.DesiredAngle | |
| 2358 | end | |
| 2359 | neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
| 2360 | neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
| 2361 | neck.Name = "Neck" | |
| 2362 | neck.Part0 = torso | |
| 2363 | neck.Part1 = head | |
| 2364 | rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) | |
| 2365 | rootJoint.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) | |
| 2366 | rootJoint.Name = "RootJoint" | |
| 2367 | rootJoint.Part0 = rootPart | |
| 2368 | rootJoint.Part1 = torso | |
| 2369 | feetPart.BottomSurface = "Smooth" | |
| 2370 | feetPart.CanCollide = false | |
| 2371 | feetPart.CFrame = torsoCFrame * CFrame.new(0, -3.1, 0) | |
| 2372 | feetPart.FormFactor = "Custom" | |
| 2373 | feetPart.Locked = true | |
| 2374 | feetPart.Name = "Platform" | |
| 2375 | feetPart.Size = Vector3.new(1.8, 0.2, 0.8) | |
| 2376 | feetPart.TopSurface = "Smooth" | |
| 2377 | feetPart.Transparency = 1 | |
| 2378 | feetWeld.C0 = CFrame.new(0, -3, 0) | |
| 2379 | feetWeld.C1 = CFrame.new(0, 0.1, 0) | |
| 2380 | feetWeld.Name = "PlatformWeld" | |
| 2381 | feetWeld.Part0 = torso | |
| 2382 | feetWeld.Part1 = feetPart | |
| 2383 | table.insert(connections, feetPart.Touched:connect(function(hit) | |
| 2384 | feetTouching[hit] = true | |
| 2385 | end)) | |
| 2386 | table.insert(connections, feetPart.TouchEnded:connect(function(hit) | |
| 2387 | feetTouching[hit] = nil | |
| 2388 | end)) | |
| 2389 | feetTouchInterest = feetPart:FindFirstChild("TouchInterest")
| |
| 2390 | bodyGyro.D = 3250 | |
| 2391 | bodyGyro.P = 400000 | |
| 2392 | bodyGyro.maxTorque = Vector3.new(1000000000, 0, 1000000000) | |
| 2393 | bodyVelocity.P = 5000 | |
| 2394 | bodyVelocity.maxForce = Vector3.new(0, 0, 0) | |
| 2395 | bodyVelocity.velocity = Vector3.new(0, 0, 0) | |
| 2396 | torsoLight = Instance.new("PointLight", torso)
| |
| 2397 | torsoLight.Brightness = 0.4 | |
| 2398 | torsoLight.Color = Color3.new(1, 1, 1) | |
| 2399 | torsoLight.Range = 16 | |
| 2400 | torsoLight.Shadows = true | |
| 2401 | local ff1, ff2, ff3, ff4, ff5, ff6, ff7, ff8, ff9 = Instance.new("ForceField", head), Instance.new("ForceField", leftArm), Instance.new("ForceField", leftLeg), Instance.new("ForceField", rightArm), Instance.new("ForceField", rightLeg), Instance.new("ForceField", torso), Instance.new("ForceField", wildcardHandle), Instance.new("ForceField", feetPart), Instance.new("ForceField", rootPart)
| |
| 2402 | local forcefields = {[ff1] = head, [ff2] = leftArm, [ff3] = leftLeg, [ff4] = rightArm, [ff5] = rightLeg, [ff6] = torso, [ff7] = wildcardHandle, [ff8] = feetPart, [ff9] = rootPart}
| |
| 2403 | local objects = {[humanoid] = true, [head] = true, [leftArm] = true, [leftLeg] = true, [rightArm] = true, [rightLeg] = true, [torso] = true, [rootPart] = true, [rootJoint] = true, [soundFreeFalling] = true, [soundGettingUp] = true, [soundRunning] = true, [leftHip] = true, [leftShoulder] = true, [rightHip] = true, [rightShoulder] = true, [neck] = true, [feetPart] = true, [feetWeld] = true, [feetTouchInterest] = true, [bodyGyro] = true, [bodyVelocity] = true, [ff1] = true, [ff2] = true, [ff3] = true, [ff4] = true, [ff5] = true, [ff6] = true, [ff7] = true, [ff8] = true, [ff9] = true}
| |
| 2404 | local tshirtUrl = appearance.tshirt | |
| 2405 | if tshirtUrl then | |
| 2406 | local tshirt = Instance.new("Decal", torso)
| |
| 2407 | tshirt.Name = "roblox" | |
| 2408 | tshirt.Texture = tshirtUrl | |
| 2409 | objects[tshirt] = true | |
| 2410 | end | |
| 2411 | for _, template in ipairs(appearance.characterObjects) do | |
| 2412 | local object = template:Clone() | |
| 2413 | local newObjects = {object}
| |
| 2414 | for _, object in ipairs(newObjects) do | |
| 2415 | objects[object] = true | |
| 2416 | for _, child in ipairs(object:GetChildren()) do | |
| 2417 | table.insert(newObjects, child) | |
| 2418 | end | |
| 2419 | end | |
| 2420 | if object:IsA("BodyColors") then
| |
| 2421 | head.BrickColor = object.HeadColor | |
| 2422 | leftArm.BrickColor = object.LeftArmColor | |
| 2423 | leftLeg.BrickColor = object.LeftLegColor | |
| 2424 | rightArm.BrickColor = object.RightArmColor | |
| 2425 | rightLeg.BrickColor = object.RightLegColor | |
| 2426 | torso.BrickColor = object.TorsoColor | |
| 2427 | elseif object:IsA("Hat") then
| |
| 2428 | local handle = object:FindFirstChild("Handle")
| |
| 2429 | if handle and handle:IsA("BasePart") then
| |
| 2430 | local weld = Instance.new("Weld", head)
| |
| 2431 | weld.C0 = CFrame.new(0, 0.5, 0) | |
| 2432 | local attachmentPos = object.AttachmentPos | |
| 2433 | local attachmentRight = object.AttachmentRight | |
| 2434 | local attachmentUp = object.AttachmentUp | |
| 2435 | local attachmentForward = object.AttachmentForward | |
| 2436 | weld.C1 = CFrame.new(attachmentPos.X, attachmentPos.Y, attachmentPos.Z, | |
| 2437 | attachmentRight.X, attachmentUp.X, -attachmentForward.X, | |
| 2438 | attachmentRight.Y, attachmentUp.Y, -attachmentForward.Y, | |
| 2439 | attachmentRight.Z, attachmentUp.Z, -attachmentForward.Z) | |
| 2440 | weld.Name = "HeadWeld" | |
| 2441 | weld.Part0 = head | |
| 2442 | weld.Part1 = handle | |
| 2443 | handle.Parent = model | |
| 2444 | local antiGravity = Instance.new("BodyForce", handle)
| |
| 2445 | antiGravity.force = Vector3.new(0, handle:GetMass() * 196.2, 0) | |
| 2446 | objects[object] = false | |
| 2447 | object.Parent = nil | |
| 2448 | objects[weld] = true | |
| 2449 | end | |
| 2450 | end | |
| 2451 | object.Parent = model | |
| 2452 | end | |
| 2453 | local facePresent = false | |
| 2454 | local headMeshPresent = false | |
| 2455 | for _, template in ipairs(appearance.headObjects) do | |
| 2456 | local object = template:Clone() | |
| 2457 | local newObjects = {object}
| |
| 2458 | for _, object in ipairs(newObjects) do | |
| 2459 | objects[object] = true | |
| 2460 | for _, child in ipairs(object:GetChildren()) do | |
| 2461 | table.insert(newObjects, child) | |
| 2462 | end | |
| 2463 | end | |
| 2464 | if object:IsA("DataModelMesh") then
| |
| 2465 | headMeshPresent = true | |
| 2466 | elseif object:IsA("Decal") then
| |
| 2467 | facePresent = true | |
| 2468 | end | |
| 2469 | object.Parent = head | |
| 2470 | end | |
| 2471 | if not facePresent then | |
| 2472 | local face = Instance.new("Decal", head)
| |
| 2473 | face.Texture = "rbxasset://textures/face.png" | |
| 2474 | objects[face] = true | |
| 2475 | end | |
| 2476 | if not headMeshPresent then | |
| 2477 | local headMesh = Instance.new("SpecialMesh", head)
| |
| 2478 | headMesh.Scale = Vector3.new(1.25, 1.25, 1.25) | |
| 2479 | objects[headMesh] = true | |
| 2480 | end | |
| 2481 | table.insert(connections, model.DescendantAdded:connect(function(object) | |
| 2482 | local success, is_localscript = pcall(Game.IsA, object, "LocalScript") | |
| 2483 | if success and is_localscript then | |
| 2484 | pcall(Utility.SetProperty, object, "Disabled", true) | |
| 2485 | local changed_connection = pcall(object.Changed.connect, object.Changed, function(property) | |
| 2486 | if property == "Disabled" and not object.Disabled then | |
| 2487 | pcall(Utility.SetProperty, object, "Disabled", true) | |
| 2488 | object:Destroy() | |
| 2489 | end | |
| 2490 | end) | |
| 2491 | end | |
| 2492 | if not objects[object] then | |
| 2493 | object:Destroy() | |
| 2494 | end | |
| 2495 | end)) | |
| 2496 | model.Parent = Workspace | |
| 2497 | Player.Character = model | |
| 2498 | Camera.CameraSubject = humanoid | |
| 2499 | Camera.CameraType = "Track" | |
| 2500 | Camera.CoordinateFrame = cameraCFrame | |
| 2501 | local IsStanding | |
| 2502 | local RegenerateHealth | |
| 2503 | local ResetCharacter | |
| 2504 | function IsStanding() | |
| 2505 | return not not next(feetTouching) | |
| 2506 | end | |
| 2507 | function RegenerateHealth() | |
| 2508 | if humanoid.Health < 1 then | |
| 2509 | humanoid.Health = 100 | |
| 2510 | elseif not regeneratingHealth then | |
| 2511 | regeneratingHealth = true | |
| 2512 | local elapsedTime = wait(1) | |
| 2513 | regeneratingHealth = false | |
| 2514 | if humanoid.Health < 100 then | |
| 2515 | humanoid.Health = math.min(humanoid.Health + elapsedTime, 100) | |
| 2516 | end | |
| 2517 | end | |
| 2518 | end | |
| 2519 | function ResetCharacter() | |
| 2520 | for index, connection in ipairs(connections) do | |
| 2521 | connection:disconnect() | |
| 2522 | end | |
| 2523 | active = false | |
| 2524 | end | |
| 2525 | table.insert(connections, model.AncestryChanged:connect(ResetCharacter)) | |
| 2526 | table.insert(connections, model.DescendantRemoving:connect(function(object) | |
| 2527 | local parent = forcefields[object] | |
| 2528 | if parent then | |
| 2529 | forcefields[object] = nil | |
| 2530 | local new_forcefield = Instance.new("ForceField")
| |
| 2531 | forcefields[new_forcefield] = parent | |
| 2532 | objects[new_forcefield] = true | |
| 2533 | new_forcefield.Parent = parent | |
| 2534 | elseif objects[object] then | |
| 2535 | ResetCharacter() | |
| 2536 | end | |
| 2537 | end)) | |
| 2538 | table.insert(connections, humanoid.HealthChanged:connect(RegenerateHealth)) | |
| 2539 | table.insert(connections, humanoid.Climbing:connect(function() pose = "Climbing" end)) | |
| 2540 | table.insert(connections, humanoid.FallingDown:connect(function(state) pose = "FallingDown" end)) | |
| 2541 | table.insert(connections, humanoid.FreeFalling:connect(function(state) pose = "FreeFall" if state then soundFreeFalling:Play() else | |
| 2542 | ||
| 2543 | soundFreeFalling:Pause() end end)) | |
| 2544 | table.insert(connections, humanoid.GettingUp:connect(function(state) pose = "GettingUp" if state then soundGettingUp:Play() else | |
| 2545 | ||
| 2546 | soundGettingUp:Pause() end end)) | |
| 2547 | table.insert(connections, humanoid.PlatformStanding:connect(function() pose = "PlatformStanding" end)) | |
| 2548 | table.insert(connections, humanoid.Seated:connect(function() pose = "Seated" end)) | |
| 2549 | table.insert(connections, humanoid.Swimming:connect(function(speed) if speed > 0 then pose = "Swimming" else pose = "Standing" end end)) | |
| 2550 | local previousRootPartCFrame = rootPart.CFrame | |
| 2551 | TaskScheduler.Start(function() | |
| 2552 | while active do | |
| 2553 | local totalTime = TaskScheduler.GetCurrentTime() | |
| 2554 | local stepTime = 1 / 60 | |
| 2555 | if not PlayerControl.characterEnabled then | |
| 2556 | ResetCharacter() | |
| 2557 | break | |
| 2558 | end | |
| 2559 | torsoLight.Brightness = 0.5 + 0.15 * math.sin(totalTime * 0.75 * math.pi) | |
| 2560 | local featherfallEnabled = PlayerControl.IsFeatherfallEnabled() | |
| 2561 | local rootPartCFrame = rootPart.CFrame | |
| 2562 | if not jumpDebounce and UserInterface:IsKeyDown(Enum.KeyCode.Space) then | |
| 2563 | if humanoid.Sit then | |
| 2564 | humanoid.Sit = false | |
| 2565 | end | |
| 2566 | if IsStanding() then | |
| 2567 | jumpDebounce = true | |
| 2568 | pose = "Jumping" | |
| 2569 | rootPart.Velocity = Vector3.new(rootPart.Velocity.X, 50, rootPart.Velocity.Z) | |
| 2570 | torso.Velocity = Vector3.new(torso.Velocity.X, 50, torso.Velocity.Z) | |
| 2571 | TaskScheduler.Schedule(1, function() | |
| 2572 | if pose == "Jumping" then | |
| 2573 | pose = "FreeFall" | |
| 2574 | end | |
| 2575 | jumpDebounce = false | |
| 2576 | humanoid.Jump = false | |
| 2577 | end) | |
| 2578 | end | |
| 2579 | end | |
| 2580 | local cameraCFrame = Camera.CoordinateFrame | |
| 2581 | local cameraDirection = cameraCFrame.lookVector | |
| 2582 | if flying then | |
| 2583 | if PlayerControl.rolling then | |
| 2584 | local rootPartCFrame = rootPart.CFrame | |
| 2585 | local speed = (rootPartCFrame - rootPartCFrame.p):pointToObjectSpace(rootPart.Velocity).Y | |
| 2586 | local decay = 0.5 ^ stepTime | |
| 2587 | if math.abs(speed) <= 50 then | |
| 2588 | PlayerControl.rollingAngle = (((PlayerControl.rollingAngle + 0.5) % 1 - 0.5) * decay) % 1 | |
| 2589 | PlayerControl.rollingOffset = PlayerControl.rollingOffset * decay | |
| 2590 | else | |
| 2591 | PlayerControl.rollingAngle = (PlayerControl.rollingAngle + stepTime * speed * PlayerControl.rollingSpeed) % 1 | |
| 2592 | PlayerControl.rollingOffset = (PlayerControl.rollingOffset + PlayerControl.rollingMaxOffset * (1 / decay - 1)) * decay | |
| 2593 | end | |
| 2594 | rootJoint.C0 = (CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) * CFrame.Angles(PlayerControl.rollingAngle * 2 * math.pi, 0, 0)) * CFrame.new(0, -PlayerControl.rollingOffset, 0) | |
| 2595 | else | |
| 2596 | rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) | |
| 2597 | PlayerControl.rollingAngle = 0 | |
| 2598 | PlayerControl.rollingOffset = 0 | |
| 2599 | end | |
| 2600 | rightShoulder.MaxVelocity = 0.5 | |
| 2601 | leftShoulder.MaxVelocity = 0.5 | |
| 2602 | rightShoulder.DesiredAngle = 0 | |
| 2603 | leftShoulder.DesiredAngle = 0 | |
| 2604 | rightHip.DesiredAngle = 0 | |
| 2605 | leftHip.DesiredAngle = 0 | |
| 2606 | bodyGyro.D = 500 | |
| 2607 | bodyGyro.P = 1e6 | |
| 2608 | bodyGyro.maxTorque = Vector3.new(1e6, 1e6, 1e6) | |
| 2609 | bodyVelocity.P = 1250 | |
| 2610 | bodyVelocity.maxForce = Vector3.new(1e6, 1e6, 1e6) | |
| 2611 | local movementRight = 0 | |
| 2612 | local movementForward = 0 | |
| 2613 | local movementUp = 0 | |
| 2614 | if UserInterface:IsKeyDown(Enum.KeyCode.A) and not UserInterface:IsKeyDown(Enum.KeyCode.D) then | |
| 2615 | movementRight = -1 | |
| 2616 | elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then | |
| 2617 | movementRight = 1 | |
| 2618 | end | |
| 2619 | if UserInterface:IsKeyDown(Enum.KeyCode.W) then | |
| 2620 | movementUp = 0.2 | |
| 2621 | if not UserInterface:IsKeyDown(Enum.KeyCode.S) then | |
| 2622 | movementForward = -1 | |
| 2623 | end | |
| 2624 | elseif UserInterface:IsKeyDown(Enum.KeyCode.S) then | |
| 2625 | movementForward = 1 | |
| 2626 | end | |
| 2627 | local movement = PlayerControl.fly_acceleration * cameraCFrame:vectorToWorldSpace(Vector3.new(movementRight, movementUp, movementForward)) | |
| 2628 | local previousMomentum = flyingMomentum | |
| 2629 | local previousTilt = flyingTilt | |
| 2630 | flyingMomentum = movement + flyingMomentum * (1 - PlayerControl.fly_acceleration / PlayerControl.fly_speed) | |
| 2631 | flyingTilt = ((flyingMomentum * Vector3.new(1, 0, 1)).unit:Cross((previousMomentum * Vector3.new(1, 0, 1)).unit)).Y | |
| 2632 | if flyingTilt ~= flyingTilt or flyingTilt == math.huge then | |
| 2633 | flyingTilt = 0 | |
| 2634 | end | |
| 2635 | local absoluteTilt = math.abs(flyingTilt) | |
| 2636 | if absoluteTilt > 0.06 or absoluteTilt < 0.0001 then | |
| 2637 | if math.abs(previousTilt) > 0.0001 then | |
| 2638 | flyingTilt = previousTilt * 0.9 | |
| 2639 | else | |
| 2640 | flyingTilt = 0 | |
| 2641 | end | |
| 2642 | else | |
| 2643 | flyingTilt = previousTilt * 0.77 + flyingTilt * 0.25 | |
| 2644 | end | |
| 2645 | previousTilt = flyingTilt | |
| 2646 | if flyingMomentum.magnitude < 0.1 then | |
| 2647 | flyingMomentum = Vector3.new(0, 0, 0) | |
| 2648 | -- bodyGyro.cframe = cameraCFrame | |
| 2649 | else | |
| 2650 | local momentumOrientation = CFrame.new(Vector3.new(0, 0, 0), flyingMomentum) | |
| 2651 | local tiltOrientation = CFrame.Angles(0, 0, -20 * flyingTilt) | |
| 2652 | bodyGyro.cframe = momentumOrientation * tiltOrientation * CFrame.Angles(-0.5 * math.pi * math.min(flyingMomentum.magnitude / PlayerControl.fly_speed, 1), 0, 0) | |
| 2653 | end | |
| 2654 | bodyVelocity.velocity = flyingMomentum + Vector3.new(0, 0.15695775618683547, 0) | |
| 2655 | rootPart.Velocity = flyingMomentum | |
| 2656 | previousMomentum = flyingMomentum | |
| 2657 | else | |
| 2658 | rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) | |
| 2659 | PlayerControl.rollingAngle = 0 | |
| 2660 | PlayerControl.rollingOffset = 0 | |
| 2661 | bodyGyro.D = 3250 | |
| 2662 | bodyGyro.P = 400000 | |
| 2663 | bodyVelocity.P = 5000 | |
| 2664 | local cameraDirection = cameraCFrame.lookVector | |
| 2665 | local walkDirection = Vector3.new(0, 0, 0) | |
| 2666 | local walkSpeed = 16 | |
| 2667 | if UserInterface:IsKeyDown(Enum.KeyCode.W) then | |
| 2668 | if UserInterface:IsKeyDown(Enum.KeyCode.A) then | |
| 2669 | walkDirection = Vector3.new(cameraDirection.X + cameraDirection.Z, 0, cameraDirection.Z - cameraDirection.X).unit | |
| 2670 | elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then | |
| 2671 | walkDirection = Vector3.new(cameraDirection.X - cameraDirection.Z, 0, cameraDirection.Z + cameraDirection.X).unit | |
| 2672 | else | |
| 2673 | walkDirection = Vector3.new(cameraDirection.X, 0, cameraDirection.Z).unit | |
| 2674 | end | |
| 2675 | elseif UserInterface:IsKeyDown(Enum.KeyCode.S) then | |
| 2676 | if UserInterface:IsKeyDown(Enum.KeyCode.A) then | |
| 2677 | walkDirection = Vector3.new(-cameraDirection.X + cameraDirection.Z, 0, -cameraDirection.Z - cameraDirection.X).unit | |
| 2678 | elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then | |
| 2679 | walkDirection = Vector3.new(-cameraDirection.X - cameraDirection.Z, 0, -cameraDirection.Z + cameraDirection.X).unit | |
| 2680 | else | |
| 2681 | walkDirection = Vector3.new(-cameraDirection.X, 0, -cameraDirection.Z).unit | |
| 2682 | end | |
| 2683 | elseif UserInterface:IsKeyDown(Enum.KeyCode.A) then | |
| 2684 | walkDirection = Vector3.new(cameraDirection.Z, 0, -cameraDirection.X).unit | |
| 2685 | elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then | |
| 2686 | walkDirection = Vector3.new(-cameraDirection.Z, 0, cameraDirection.X).unit | |
| 2687 | else | |
| 2688 | walkSpeed = 0 | |
| 2689 | end | |
| 2690 | if walkSpeed ~= previousWalkSpeed then | |
| 2691 | if walkSpeed > 0 then | |
| 2692 | soundRunning:Play() | |
| 2693 | else | |
| 2694 | soundRunning:Pause() | |
| 2695 | end | |
| 2696 | end | |
| 2697 | if walkSpeed > 0 then | |
| 2698 | if pose ~= "Jumping" then | |
| 2699 | if IsStanding() then | |
| 2700 | pose = "Running" | |
| 2701 | else | |
| 2702 | pose = "FreeFall" | |
| 2703 | end | |
| 2704 | end | |
| 2705 | bodyGyro.cframe = CFrame.new(Vector3.new(), walkDirection) | |
| 2706 | bodyGyro.maxTorque = Vector3.new(1000000000, 1000000000, 1000000000) | |
| 2707 | bodyVelocity.maxForce = Vector3.new(1000000, maxForceY, 1000000) | |
| 2708 | else | |
| 2709 | if pose ~= "Jumping" then | |
| 2710 | if IsStanding() then | |
| 2711 | pose = "Standing" | |
| 2712 | else | |
| 2713 | pose = "FreeFall" | |
| 2714 | end | |
| 2715 | end | |
| 2716 | -- TODO: find and fix bug that causes torso to rotate back to some angle | |
| 2717 | bodyGyro.maxTorque = Vector3.new(1000000000, 1000000000, 1000000000) -- Vector3.new(1000000000, 0, 1000000000) | |
| 2718 | if PlayerControl.pushable then | |
| 2719 | bodyVelocity.maxForce = Vector3.new(0, 0, 0) | |
| 2720 | else | |
| 2721 | bodyVelocity.maxForce = Vector3.new(1000000, 0, 1000000) | |
| 2722 | end | |
| 2723 | end | |
| 2724 | if featherfallEnabled then | |
| 2725 | local velocity = rootPart.Velocity | |
| 2726 | if velocity.Y > 50 then | |
| 2727 | rootPart.Velocity = Vector3.new(velocity.X, 50, velocity.Z) | |
| 2728 | elseif velocity.Y < -50 then | |
| 2729 | rootPart.Velocity = Vector3.new(velocity.X, -50, velocity.Z) | |
| 2730 | end | |
| 2731 | local distanceVector = rootPartCFrame.p - previousRootPartCFrame.p | |
| 2732 | local offsetX, offsetY, offsetZ = distanceVector.X, distanceVector.Y, distanceVector.Z | |
| 2733 | local MAX_MOVEMENT = 50 * 0.03333333507180214 | |
| 2734 | if offsetX > MAX_MOVEMENT then | |
| 2735 | offsetX = MAX_MOVEMENT | |
| 2736 | elseif offsetX < -MAX_MOVEMENT then | |
| 2737 | offsetX = -MAX_MOVEMENT | |
| 2738 | end | |
| 2739 | if offsetY > MAX_MOVEMENT then | |
| 2740 | offsetY = MAX_MOVEMENT | |
| 2741 | elseif offsetY < -MAX_MOVEMENT then | |
| 2742 | offsetY = -MAX_MOVEMENT | |
| 2743 | end | |
| 2744 | if offsetZ > MAX_MOVEMENT then | |
| 2745 | offsetZ = MAX_MOVEMENT | |
| 2746 | elseif offsetZ < -MAX_MOVEMENT then | |
| 2747 | offsetZ = -MAX_MOVEMENT | |
| 2748 | end | |
| 2749 | local offset = Vector3.new(offsetX, offsetY, offsetZ) | |
| 2750 | if offset ~= distanceVector then | |
| 2751 | rootPartCFrame = previousRootPartCFrame + offset | |
| 2752 | --rootPart.CFrame = rootPartCFrame | |
| 2753 | end | |
| 2754 | end | |
| 2755 | local walkingVelocity = walkDirection * walkSpeed | |
| 2756 | bodyVelocity.velocity = walkingVelocity | |
| 2757 | if not jumpDebounce and math.abs(rootPart.Velocity.Y) <= 0.1 then | |
| 2758 | rootPart.Velocity = Vector3.new(walkingVelocity.X, rootPart.Velocity.Y, walkingVelocity.Z) | |
| 2759 | end | |
| 2760 | previousWalkSpeed = walkSpeed | |
| 2761 | if pose == "Jumping" or jumpDebounce then | |
| 2762 | rightShoulder.MaxVelocity = 0.5 | |
| 2763 | leftShoulder.MaxVelocity = 0.5 | |
| 2764 | rightShoulder.DesiredAngle = 3.14 | |
| 2765 | leftShoulder.DesiredAngle = -3.14 | |
| 2766 | rightHip.DesiredAngle = 0 | |
| 2767 | leftHip.DesiredAngle = 0 | |
| 2768 | elseif pose == "FreeFall" then | |
| 2769 | rightShoulder.MaxVelocity = 0.5 | |
| 2770 | leftShoulder.MaxVelocity = 0.5 | |
| 2771 | rightShoulder.DesiredAngle = 3.14 | |
| 2772 | leftShoulder.DesiredAngle = -3.14 | |
| 2773 | rightHip.DesiredAngle = 0 | |
| 2774 | leftHip.DesiredAngle = 0 | |
| 2775 | elseif pose == "Seated" then | |
| 2776 | rightShoulder.MaxVelocity = 0.15 | |
| 2777 | leftShoulder.MaxVelocity = 0.15 | |
| 2778 | rightShoulder.DesiredAngle = 3.14 / 2 | |
| 2779 | leftShoulder.DesiredAngle = -3.14 / 2 | |
| 2780 | rightHip.DesiredAngle = 3.14 / 2 | |
| 2781 | leftHip.DesiredAngle = -3.14 / 2 | |
| 2782 | else | |
| 2783 | local climbFudge = 0 | |
| 2784 | local amplitude | |
| 2785 | local frequency | |
| 2786 | if pose == "Running" then | |
| 2787 | rightShoulder.MaxVelocity = 0.15 | |
| 2788 | leftShoulder.MaxVelocity = 0.15 | |
| 2789 | amplitude = 1 | |
| 2790 | frequency = 9 | |
| 2791 | elseif (pose == "Climbing") then | |
| 2792 | rightShoulder.MaxVelocity = 0.5 | |
| 2793 | leftShoulder.MaxVelocity = 0.5 | |
| 2794 | amplitude = 1 | |
| 2795 | frequency = 9 | |
| 2796 | climbFudge = 3.14 | |
| 2797 | else | |
| 2798 | amplitude = 0.1 | |
| 2799 | frequency = 1 | |
| 2800 | end | |
| 2801 | local desiredAngle = amplitude * math.sin(totalTime * frequency) | |
| 2802 | rightShoulder.DesiredAngle = desiredAngle + climbFudge | |
| 2803 | leftShoulder.DesiredAngle = desiredAngle - climbFudge | |
| 2804 | rightHip.DesiredAngle = -desiredAngle | |
| 2805 | leftHip.DesiredAngle = -desiredAngle | |
| 2806 | end | |
| 2807 | end | |
| 2808 | previousRootPartCFrame = rootPartCFrame | |
| 2809 | RunService.RenderStepped:wait() | |
| 2810 | end | |
| 2811 | if model.Parent ~= nil then | |
| 2812 | model.Parent = nil | |
| 2813 | end | |
| 2814 | PlayerControl.CreateCharacter() | |
| 2815 | end) | |
| 2816 | humanoid.Health = 100 | |
| 2817 | character = model | |
| 2818 | chatAdornee = head | |
| 2819 | elseif characterMode == "pyramid" then | |
| 2820 | if PlayerControl.characterEnabled then | |
| 2821 | Camera.CameraType = "Fixed" | |
| 2822 | PyramidCharacter.camera_distance = (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude | |
| 2823 | PyramidCharacter.camera_position = Camera.Focus.p | |
| 2824 | PyramidCharacter.Teleport(Camera.Focus.p) | |
| 2825 | PyramidCharacter.visible = true | |
| 2826 | Player.Character = nil | |
| 2827 | else | |
| 2828 | PyramidCharacter.visible = false | |
| 2829 | end | |
| 2830 | end | |
| 2831 | end | |
| 2832 | function PlayerControl.GetCharacter() | |
| 2833 | return character | |
| 2834 | end | |
| 2835 | function PlayerControl.GetHead() | |
| 2836 | local characterMode = PlayerControl.characterMode | |
| 2837 | if characterMode == "normal" then | |
| 2838 | return head | |
| 2839 | elseif characterMode == "pyramid" then | |
| 2840 | return PyramidCharacter.core | |
| 2841 | end | |
| 2842 | end | |
| 2843 | function PlayerControl.GetHumanoid() | |
| 2844 | return humanoid | |
| 2845 | end | |
| 2846 | function PlayerControl.GetRootPart() | |
| 2847 | return rootPart | |
| 2848 | end | |
| 2849 | function PlayerControl.GetTorso() | |
| 2850 | return torso | |
| 2851 | end | |
| 2852 | function PlayerControl.IsEnabled() | |
| 2853 | return PlayerControl.characterEnabled | |
| 2854 | end | |
| 2855 | function PlayerControl.IsFeatherfallEnabled() | |
| 2856 | return PlayerControl.featherfallEnabled | |
| 2857 | end | |
| 2858 | function PlayerControl.IsPushable() | |
| 2859 | return PlayerControl.pushable | |
| 2860 | end | |
| 2861 | function PlayerControl.IsRolling() | |
| 2862 | return PlayerControl.rolling | |
| 2863 | end | |
| 2864 | function PlayerControl.ResetCharacter() | |
| 2865 | if character and character.Parent then | |
| 2866 | character.Parent = nil | |
| 2867 | end | |
| 2868 | PyramidCharacter.visible = false | |
| 2869 | end | |
| 2870 | function PlayerControl.SetEnabled(state, no_animation) | |
| 2871 | state = not not state | |
| 2872 | if state ~= PlayerControl.characterEnabled then | |
| 2873 | PlayerControl.characterEnabled = state | |
| 2874 | local characterMode = PlayerControl.characterMode | |
| 2875 | if characterMode == "normal" then | |
| 2876 | local torso = PlayerControl.GetRootPart() | |
| 2877 | local rootPart = PlayerControl.GetRootPart() | |
| 2878 | if rootPart then | |
| 2879 | if PlayerControl.characterEnabled then | |
| 2880 | local torso_cframe = Camera.Focus:toWorldSpace(PlayerControl.hide_torso_object_cframe) | |
| 2881 | PlayerControl.torso_cframe = torso_cframe | |
| 2882 | torso.CFrame = torso_cframe | |
| 2883 | rootPart.CFrame = torso_cframe | |
| 2884 | else | |
| 2885 | PlayerControl.hide_torso_object_cframe = Camera.Focus:toObjectSpace(rootPart.CFrame) | |
| 2886 | end | |
| 2887 | else | |
| 2888 | PlayerControl.torso_cframe = Camera.Focus | |
| 2889 | end | |
| 2890 | if PlayerControl.characterEnabled then | |
| 2891 | PlayerControl.CreateCharacter() | |
| 2892 | RunService.Stepped:wait() | |
| 2893 | coroutine.yield() | |
| 2894 | if not no_animation then | |
| 2895 | GraphicalEffects.CrystalRing({base_part = PlayerControl.GetTorso(), crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
| |
| 2896 | end | |
| 2897 | else | |
| 2898 | Player.Character = nil | |
| 2899 | Camera.CameraType = "Fixed" | |
| 2900 | if not no_animation then | |
| 2901 | GraphicalEffects.CrystalRing({position = PlayerControl.GetTorso().Position, crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
| |
| 2902 | end | |
| 2903 | end | |
| 2904 | else | |
| 2905 | if state then | |
| 2906 | PlayerControl.CreateCharacter() | |
| 2907 | RunService.Stepped:wait() | |
| 2908 | coroutine.yield() | |
| 2909 | if not no_animation then | |
| 2910 | GraphicalEffects.CrystalRing({base_part = PyramidCharacter.core, crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
| |
| 2911 | end | |
| 2912 | else | |
| 2913 | PyramidCharacter.visible = false | |
| 2914 | if not no_animation then | |
| 2915 | GraphicalEffects.CrystalRing({position = PyramidCharacter.core.Position, crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
| |
| 2916 | end | |
| 2917 | end | |
| 2918 | end | |
| 2919 | end | |
| 2920 | end | |
| 2921 | function PlayerControl.SetFeatherfallEnabled(state) | |
| 2922 | state = not not state | |
| 2923 | if state ~= PlayerControl.featherfallEnabled then | |
| 2924 | PlayerControl.featherfallEnabled = state | |
| 2925 | if state then | |
| 2926 | Logger.print("Info", "Featherfall enabled in PlayerControl")
| |
| 2927 | else | |
| 2928 | Logger.print("Info", "Featherfall disabled in PlayerControl")
| |
| 2929 | end | |
| 2930 | end | |
| 2931 | end | |
| 2932 | function PlayerControl.SetPushable(state) | |
| 2933 | state = not not state | |
| 2934 | if state ~= PlayerControl.pushable then | |
| 2935 | PlayerControl.pushable = state | |
| 2936 | if state then | |
| 2937 | Logger.print("Info", "Pushing enabled in PlayerControl")
| |
| 2938 | else | |
| 2939 | Logger.print("Info", "Pushing disabled in PlayerControl")
| |
| 2940 | end | |
| 2941 | end | |
| 2942 | end | |
| 2943 | function PlayerControl.SetRolling(state) | |
| 2944 | state = not not state | |
| 2945 | if state ~= PlayerControl.rolling then | |
| 2946 | PlayerControl.rolling = state | |
| 2947 | if state then | |
| 2948 | Logger.print("Info", "Rolling fly mode enabled in PlayerControl")
| |
| 2949 | else | |
| 2950 | Logger.print("Info", "Rolling fly mode disabled in PlayerControl")
| |
| 2951 | end | |
| 2952 | end | |
| 2953 | end | |
| 2954 | function PlayerControl.StartFlying() | |
| 2955 | PlayerControl.fly_speed = PlayerControl.fly_basespeed | |
| 2956 | if torso then | |
| 2957 | flyingMomentum = torso.Velocity + torso.CFrame.lookVector * 3 + Vector3.new(0, 10, 0) | |
| 2958 | else | |
| 2959 | flyingMomentum = Vector3.new() | |
| 2960 | end | |
| 2961 | flyingTilt = 0 | |
| 2962 | flying = true | |
| 2963 | end | |
| 2964 | function PlayerControl.StopFlying() | |
| 2965 | if bodyGyro.cframe then | |
| 2966 | local lookVector = bodyGyro.cframe.lookVector | |
| 2967 | if lookVector.X ~= 0 or lookVector.Z ~= 0 then | |
| 2968 | bodyGyro.cframe = CFrame.new(Vector3.new(), Vector3.new(lookVector.X, 0, lookVector.Z)) | |
| 2969 | end | |
| 2970 | end | |
| 2971 | flying = false | |
| 2972 | end | |
| 2973 | local previousTime = 0 | |
| 2974 | ||
| 2975 | ControllerCommands = {};
| |
| 2976 | ||
| 2977 | ControllerCommands = {};
| |
| 2978 | ||
| 2979 | ControllerCommands.BALEFIRE_SPEED = 40 | |
| 2980 | function ControllerCommands.BalefireAtMouse() | |
| 2981 | local head = chatAdornee | |
| 2982 | if head then | |
| 2983 | local target = Mouse.Hit.p | |
| 2984 | local origin = head.Position | |
| 2985 | local direction = (target - origin).unit | |
| 2986 | local explosionCount = 0 | |
| 2987 | local animation_frame = 0 | |
| 2988 | local magic_circle_position = origin + direction * 4 | |
| 2989 | local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) | |
| 2990 | local magic_circle_part = Instance.new("Part")
| |
| 2991 | local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part)
| |
| 2992 | local magic_circle_light = Instance.new("PointLight", magic_circle_part)
| |
| 2993 | local magic_circle_decal_back = Instance.new("Decal", magic_circle_part)
| |
| 2994 | local magic_circle_decal_front = Instance.new("Decal", magic_circle_part)
| |
| 2995 | magic_circle_part.Anchored = true | |
| 2996 | magic_circle_part.Archivable = false | |
| 2997 | magic_circle_part.BottomSurface = "Smooth" | |
| 2998 | magic_circle_part.CanCollide = false | |
| 2999 | magic_circle_part.CFrame = magic_circle_cframe | |
| 3000 | magic_circle_part.FormFactor = "Custom" | |
| 3001 | magic_circle_part.Locked = true | |
| 3002 | magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 3003 | magic_circle_part.TopSurface = "Smooth" | |
| 3004 | magic_circle_part.Transparency = 1 | |
| 3005 | magic_circle_mesh.Scale = Vector3.new(60, 60, 0) | |
| 3006 | magic_circle_light.Color = Color3.new(1, 0.5, 1) | |
| 3007 | magic_circle_light.Range = 16 | |
| 3008 | magic_circle_light.Shadows = true | |
| 3009 | magic_circle_decal_back.Face = "Back" | |
| 3010 | magic_circle_decal_back.Texture = "rbxassetid://122610943" | |
| 3011 | magic_circle_decal_front.Face = "Front" | |
| 3012 | magic_circle_decal_front.Texture = "rbxassetid://122610943" | |
| 3013 | local function NextExplosion() | |
| 3014 | explosionCount = explosionCount + 1 | |
| 3015 | Instance.new("Explosion", Workspace).Position = origin + direction * (explosionCount * 8 + 4)
| |
| 3016 | end | |
| 3017 | local function AnimateMagicCircle() | |
| 3018 | animation_frame = animation_frame + 1 | |
| 3019 | local transparency = (animation_frame / 40) ^ 3 | |
| 3020 | if animation_frame == 40 then | |
| 3021 | pcall(Game.Destroy, magic_circle_part) | |
| 3022 | else | |
| 3023 | if magic_circle_part.Parent ~= Workspace then | |
| 3024 | pcall(Utility.SetProperty, magic_circle_part, "Parent", Workspace) | |
| 3025 | end | |
| 3026 | head = PlayerControl.GetHead() | |
| 3027 | if head then | |
| 3028 | magic_circle_position = head.Position + direction * 4 | |
| 3029 | end | |
| 3030 | magic_circle_part.CFrame = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, | |
| 3031 | ||
| 3032 | math.tau * animation_frame / 40 * 1.5) | |
| 3033 | magic_circle_light.Brightness = 1 - transparency | |
| 3034 | magic_circle_decal_back.Transparency = transparency | |
| 3035 | magic_circle_decal_front.Transparency = transparency | |
| 3036 | end | |
| 3037 | end | |
| 3038 | magic_circle_part.Parent = Workspace | |
| 3039 | for i = 1, 40 do | |
| 3040 | Delay((i - 1) / ControllerCommands.BALEFIRE_SPEED, NextExplosion) | |
| 3041 | Delay((i - 1) / 30, AnimateMagicCircle) | |
| 3042 | end | |
| 3043 | for i = 1, 20 do | |
| 3044 | Delay((i - 1) / ControllerCommands.BALEFIRE_SPEED, NextExplosion) | |
| 3045 | end | |
| 3046 | end | |
| 3047 | end | |
| 3048 | function ControllerCommands.ControlRandomDummy() | |
| 3049 | local dummies = {}
| |
| 3050 | local numDummies = 0 | |
| 3051 | for _, character in ipairs(Workspace:GetChildren()) do | |
| 3052 | local name = tostring(character) | |
| 3053 | if name == "???" or name == "Dummy" then | |
| 3054 | local head, humanoid | |
| 3055 | for _, child in ipairs(character:GetChildren()) do | |
| 3056 | local className = child.ClassName | |
| 3057 | if className == "Part" and tostring(child) == "Head" then | |
| 3058 | head = child | |
| 3059 | if humanoid then | |
| 3060 | break | |
| 3061 | end | |
| 3062 | elseif className == "Humanoid" then | |
| 3063 | if child.Health > 0 then | |
| 3064 | humanoid = child | |
| 3065 | if head then | |
| 3066 | break | |
| 3067 | end | |
| 3068 | else | |
| 3069 | break | |
| 3070 | end | |
| 3071 | end | |
| 3072 | end | |
| 3073 | if head and humanoid then | |
| 3074 | numDummies = numDummies + 1 | |
| 3075 | dummies[numDummies] = {character, head, humanoid}
| |
| 3076 | end | |
| 3077 | end | |
| 3078 | end | |
| 3079 | if numDummies > 0 then | |
| 3080 | local dummy = dummies[math.random(numDummies)] | |
| 3081 | Player.Character = dummy[1] | |
| 3082 | chatAdornee = dummy[2] | |
| 3083 | Camera.CameraSubject = dummy[3] | |
| 3084 | Camera.CameraType = "Track" | |
| 3085 | end | |
| 3086 | end | |
| 3087 | function ControllerCommands.Decalify(textures, exclusion) | |
| 3088 | local objects = Workspace:GetChildren() | |
| 3089 | for _, object in ipairs(objects) do | |
| 3090 | if not exclusion[object] then | |
| 3091 | for _, child in ipairs(object:GetChildren()) do | |
| 3092 | objects[#objects + 1] = child | |
| 3093 | end | |
| 3094 | if object:IsA("BasePart") then
| |
| 3095 | local texture = textures[math.random(#textures)] | |
| 3096 | local face_left = Instance.new("Decal", object)
| |
| 3097 | face_left.Face = Enum.NormalId.Left | |
| 3098 | face_left.Texture = texture | |
| 3099 | local face_right = Instance.new("Decal", object)
| |
| 3100 | face_right.Face = Enum.NormalId.Right | |
| 3101 | face_right.Texture = texture | |
| 3102 | local face_bottom = Instance.new("Decal", object)
| |
| 3103 | face_bottom.Face = Enum.NormalId.Bottom | |
| 3104 | face_bottom.Texture = texture | |
| 3105 | local face_top = Instance.new("Decal", object)
| |
| 3106 | face_top.Face = Enum.NormalId.Top | |
| 3107 | face_top.Texture = texture | |
| 3108 | local face_front = Instance.new("Decal", object)
| |
| 3109 | face_front.Face = Enum.NormalId.Front | |
| 3110 | face_front.Texture = texture | |
| 3111 | local face_back = Instance.new("Decal", object)
| |
| 3112 | face_back.Face = Enum.NormalId.Back | |
| 3113 | face_back.Texture = texture | |
| 3114 | end | |
| 3115 | end | |
| 3116 | end | |
| 3117 | end | |
| 3118 | ||
| 3119 | function ControllerCommands.ExplodeAtMouse() | |
| 3120 | local explosion = Instance.new("Explosion")
| |
| 3121 | explosion.Position = Mouse.Hit.p | |
| 3122 | explosion.Parent = Workspace | |
| 3123 | end | |
| 3124 | function ControllerCommands.LaserAtMouse() | |
| 3125 | GraphicalEffects.ShootLaserOfDeath(Mouse.Hit.p) | |
| 3126 | end | |
| 3127 | function ControllerCommands.BigLaser(target) | |
| 3128 | GraphicalEffects.ShootLaserOfDeath(target, {brickcolor = BrickColor.new("New Yeller"), duration = 80, fragmentation_size = 6,laser_scale = 30, light_color = Color3.new(1, 0.5, 0), magic_circle_image = "rbxassetid://126561317", magic_circle_scale = 1.5, sound_volume = 1,special_effects = BrickColor.new("Deep orange"), stay = 2})
| |
| 3129 | end | |
| 3130 | function ControllerCommands.BigLaserAtMouse() | |
| 3131 | ControllerCommands.BigLaser(Mouse.Hit.p) | |
| 3132 | end | |
| 3133 | function ControllerCommands.ShootMissile(targetPart, pointOnPart, direction) | |
| 3134 | GraphicalEffects.ShootMissile(targetPart, pointOnPart, direction) | |
| 3135 | end | |
| 3136 | function ControllerCommands.ShootMissileAtMouse(amount, spread, delayTime) | |
| 3137 | local exclusionList = {}
| |
| 3138 | local playerHead = PlayerControl.GetHead() | |
| 3139 | local playerTorso = PlayerControl.GetTorso() | |
| 3140 | if playerHead and playerTorso then | |
| 3141 | exclusionList[playerTorso] = true | |
| 3142 | local humanoid, torso = Utility.FindHumanoidClosestToRay(Mouse.UnitRay, exclusionList) | |
| 3143 | local targetPart, pointOnPart | |
| 3144 | if humanoid and torso then | |
| 3145 | targetPart, pointOnPart = torso, Vector3.new() | |
| 3146 | else | |
| 3147 | local target = Mouse.Target | |
| 3148 | if target then | |
| 3149 | targetPart, pointOnPart = target, target.CFrame:pointToObjectSpace(Mouse.Hit.p) | |
| 3150 | else | |
| 3151 | return | |
| 3152 | end | |
| 3153 | end | |
| 3154 | if targetPart then | |
| 3155 | local direction = (Mouse.Hit.p - playerHead.Position).unit | |
| 3156 | delayTime = delayTime or 0 | |
| 3157 | for index = 1, amount do | |
| 3158 | local angles = math.tau * (index - 0.5) * spread / amount * Vector3.new(math.random() - 0.5, math.random() - 0.5,math.random() - 0.5).unit | |
| 3159 | TaskScheduler.Schedule(delayTime * (index - 1), ControllerCommands.ShootMissile, targetPart, pointOnPart, CFrame.Angles(angles.X, angles.Y, angles.Z) * direction) | |
| 3160 | end | |
| 3161 | end | |
| 3162 | end | |
| 3163 | end | |
| 3164 | function ControllerCommands.ShootMissileAroundMouse(amount, offset, delayTime) | |
| 3165 | local exclusionList = {}
| |
| 3166 | local playerHead = PlayerControl.GetHead() | |
| 3167 | local playerTorso = PlayerControl.GetTorso() | |
| 3168 | if playerHead and playerTorso then | |
| 3169 | exclusionList[playerTorso] = true | |
| 3170 | local humanoid, torso = Utility.FindHumanoidClosestToRay(Mouse.UnitRay, exclusionList) | |
| 3171 | local targetPart, pointOnPart | |
| 3172 | if humanoid and torso then | |
| 3173 | targetPart, pointOnPart = torso, Vector3.new() | |
| 3174 | else | |
| 3175 | local target = Mouse.Target | |
| 3176 | if target then | |
| 3177 | targetPart, pointOnPart = target, target.CFrame:pointToObjectSpace(Mouse.Hit.p) | |
| 3178 | else | |
| 3179 | return | |
| 3180 | end | |
| 3181 | end | |
| 3182 | if targetPart then | |
| 3183 | delayTime = delayTime or 0 | |
| 3184 | local index = 1 | |
| 3185 | local targetPoint = targetPart.CFrame * pointOnPart | |
| 3186 | local rotation_offset_angles = math.tau * Vector3.new(math.random() - 0.5, math.random() - 0.5, 0).unit | |
| 3187 | local rotation_offset = CFrame.Angles(rotation_offset_angles.x, rotation_offset_angles.y, 0) | |
| 3188 | local angle_x = 0 | |
| 3189 | local angle_x_step = math.tau / math.phi | |
| 3190 | for i = 1, 8 * amount do | |
| 3191 | angle_x = angle_x + angle_x_step | |
| 3192 | local direction = rotation_offset * (CFrame.Angles(0, math.tau * index / amount, 0) * CFrame.Angles(angle_x, 0,0).lookVector) | |
| 3193 | local blocked = Workspace:FindPartOnRay(Ray.new(targetPoint, direction * offset), targetPart.Parent) | |
| 3194 | if not blocked then | |
| 3195 | local p0, p1, p2, p3 = targetPart, pointOnPart, direction, offset; GraphicalEffects.ShootMissile(p0, p1, p2, function() return p0 end, p3, true) | |
| 3196 | index = index + 1 | |
| 3197 | if index > amount then | |
| 3198 | break | |
| 3199 | end | |
| 3200 | end | |
| 3201 | end | |
| 3202 | end | |
| 3203 | end | |
| 3204 | end | |
| 3205 | ||
| 3206 | function ControllerCommands.HugeExplosionOfDoom(position) | |
| 3207 | local connections = {}
| |
| 3208 | local parts = {}
| |
| 3209 | local cframe = CFrame.new(position) | |
| 3210 | local function ExplosionHit(part) | |
| 3211 | if part:GetMass() < 10000 and part.Parent ~= Camera then | |
| 3212 | parts[part] = true | |
| 3213 | part.Anchored = true | |
| 3214 | part:BreakJoints() | |
| 3215 | part.BrickColor = BrickColor.new("Instituational white")
| |
| 3216 | end | |
| 3217 | end | |
| 3218 | for i = 1, 4 do | |
| 3219 | local quantity = 0.5 * i * (1 + i) | |
| 3220 | local fraction = math.tau / quantity | |
| 3221 | for x = 1, quantity do | |
| 3222 | for y = 1, quantity do | |
| 3223 | local explosion = Instance.new("Explosion")
| |
| 3224 | connections[#connections + 1] = explosion.Hit:connect(ExplosionHit) | |
| 3225 | explosion.BlastRadius = 5 | |
| 3226 | explosion.Position = cframe * (CFrame.Angles(fraction * x, fraction * y, 0) * Vector3.new((i - 1) * 6, 0, 0)) | |
| 3227 | explosion.Parent = Workspace | |
| 3228 | end | |
| 3229 | end | |
| 3230 | wait(0.075) | |
| 3231 | end | |
| 3232 | for part in pairs(parts) do | |
| 3233 | for _, child in ipairs(part:GetChildren()) do | |
| 3234 | if child:IsA("BodyMover") then
| |
| 3235 | child:Destroy() | |
| 3236 | end | |
| 3237 | end | |
| 3238 | local mass = part:GetMass() | |
| 3239 | local velocity = CFrame.Angles(math.tau * math.random(), math.tau * math.random(), 0) * Vector3.new(25, 0, 0) | |
| 3240 | local bodythrust = Instance.new("BodyThrust")
| |
| 3241 | bodythrust.force = mass * -velocity | |
| 3242 | bodythrust.Parent = part | |
| 3243 | local bodyforce = Instance.new("BodyForce")
| |
| 3244 | bodyforce.force = mass * Vector3.new(0, 196.2, 0) | |
| 3245 | bodyforce.Parent = part | |
| 3246 | part.Anchored = false | |
| 3247 | part.Reflectance = 1 | |
| 3248 | part.RotVelocity = math.tau * Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5) | |
| 3249 | part.Transparency = 0.5 | |
| 3250 | part.Velocity = (part.CFrame - part.Position) * velocity | |
| 3251 | end | |
| 3252 | for _, connection in ipairs(connections) do | |
| 3253 | connection:disconnect() | |
| 3254 | end | |
| 3255 | for i = 0, 99 do | |
| 3256 | Delay(i / 10, function() | |
| 3257 | for part in pairs(parts) do | |
| 3258 | local new_transparency = 0.5 * (1 + i / 50) | |
| 3259 | part.Reflectance = 0.98 * part.Reflectance | |
| 3260 | if new_transparency > part.Transparency then | |
| 3261 | part.Transparency = new_transparency | |
| 3262 | end | |
| 3263 | end | |
| 3264 | end) | |
| 3265 | end | |
| 3266 | Delay(10, function() | |
| 3267 | for part in pairs(parts) do | |
| 3268 | pcall(part.Destroy, part) | |
| 3269 | end | |
| 3270 | end) | |
| 3271 | end | |
| 3272 | function ControllerCommands.HugeExplosionOfDoomAtMouse() | |
| 3273 | ControllerCommands.HugeExplosionOfDoom(Mouse.Hit.p) | |
| 3274 | end | |
| 3275 | ||
| 3276 | function ControllerCommands.SpaceHyperBeam(asd) | |
| 3277 | GraphicalEffects.SpaceHyperBeam(asd) | |
| 3278 | end | |
| 3279 | function ControllerCommands.SpaceHyperBeamAtMouse() | |
| 3280 | ControllerCommands.SpaceHyperBeam(Mouse.Hit.p) | |
| 3281 | end | |
| 3282 | function ControllerCommands.ConcentratedSpaceHyperBeamAtMouse() | |
| 3283 | local p = Mouse.Hit.p; for i = 1, 50 do GraphicalEffects.SpaceHyperBeam(p) end | |
| 3284 | end | |
| 3285 | ||
| 3286 | function ControllerCommands.TeleportCharacterToMouse() | |
| 3287 | if PlayerControl.IsEnabled() then | |
| 3288 | local torso = PlayerControl.GetTorso() | |
| 3289 | if torso then | |
| 3290 | local pos = Mouse.Hit.p + Vector3.new(0, 5, 0) | |
| 3291 | torso.CFrame = CFrame.new(pos, pos + torso.CFrame.lookVector) | |
| 3292 | end | |
| 3293 | else | |
| 3294 | local new_focus_position = Mouse.Hit.p | |
| 3295 | local direction_vector = Camera.CoordinateFrame.lookVector | |
| 3296 | local new_focus = CFrame.new(new_focus_position, new_focus_position + direction_vector) | |
| 3297 | Camera.CoordinateFrame = new_focus * CFrame.new(0, 0, 25) | |
| 3298 | Camera.Focus = new_focus | |
| 3299 | end | |
| 3300 | end | |
| 3301 | ||
| 3302 | AdvancedGUI = {};
| |
| 3303 | ||
| 3304 | if not AdvancedGUI.GUI_BASE_COLOR then | |
| 3305 | AdvancedGUI.GUI_BASE_COLOR = Color3.new(0, 0, 0) | |
| 3306 | end | |
| 3307 | function AdvancedGUI.GenerateChatColor(speakerName) | |
| 3308 | local chatColor = ChatColor.Get(speakerName).Color | |
| 3309 | local brightness = chatColor.r + chatColor.g + chatColor.b | |
| 3310 | if brightness < 1.5 then | |
| 3311 | chatColor = Color3.new(math.min(1, 0.4 + chatColor.r), math.min(1, 0.4 + chatColor.g), math.min(1, 0.4 + chatColor.b)) | |
| 3312 | else | |
| 3313 | chatColor = Color3.new(math.min(1, 0.05 + chatColor.r), math.min(1, 0.05 + chatColor.g), math.min(1, 0.05 + chatColor.b)) | |
| 3314 | end | |
| 3315 | return chatColor | |
| 3316 | end | |
| 3317 | GuiBase = {}
| |
| 3318 | GuiBase.__index = GuiBase | |
| 3319 | function GuiBase:new(data) | |
| 3320 | local instance = setmetatable({}, self)
| |
| 3321 | instance:Init(data) | |
| 3322 | return instance | |
| 3323 | end | |
| 3324 | function GuiBase:Destroy() | |
| 3325 | if self.parent then | |
| 3326 | self.parent.children[self] = nil | |
| 3327 | end | |
| 3328 | for child in pairs(self.children) do | |
| 3329 | child:Destroy() | |
| 3330 | end | |
| 3331 | self.m_base_instance:Destroy() | |
| 3332 | end | |
| 3333 | function GuiBase:GetContentInstance(child) | |
| 3334 | return self.m_base_instance | |
| 3335 | end | |
| 3336 | function GuiBase:Init() | |
| 3337 | self.children = {}
| |
| 3338 | end | |
| 3339 | function GuiBase:IsA(className) | |
| 3340 | return className == "GuiBase" | |
| 3341 | end | |
| 3342 | function GuiBase:SetParent(parent) | |
| 3343 | if parent ~= self.parent then | |
| 3344 | if self.parent then | |
| 3345 | self.parent.children[self] = nil | |
| 3346 | end | |
| 3347 | self.parent = parent | |
| 3348 | if parent then | |
| 3349 | parent.children[self] = true | |
| 3350 | self.m_base_instance.Parent = parent:GetContentInstance() | |
| 3351 | else | |
| 3352 | self.m_base_instance.Parent = nil | |
| 3353 | end | |
| 3354 | end | |
| 3355 | end | |
| 3356 | GuiObject = setmetatable({}, GuiBase)
| |
| 3357 | GuiObject.__index = GuiObject | |
| 3358 | function GuiObject:Destroy() | |
| 3359 | self.DragBegin:disconnect() | |
| 3360 | self.DragMove:disconnect() | |
| 3361 | self.DragStopped:disconnect() | |
| 3362 | self.MouseButton1Click:disconnect() | |
| 3363 | self.MouseButton1Down:disconnect() | |
| 3364 | self.MouseButton1Up:disconnect() | |
| 3365 | self.MouseButton2Down:disconnect() | |
| 3366 | self.MouseButton2Up:disconnect() | |
| 3367 | self.MouseEnter:disconnect() | |
| 3368 | self.MouseLeave:disconnect() | |
| 3369 | GuiBase.Destroy(self) | |
| 3370 | end | |
| 3371 | function GuiObject:GetAbsolutePosition() | |
| 3372 | return self.m_base_instance.AbsolutePosition | |
| 3373 | end | |
| 3374 | function GuiObject:GetAbsoluteSize() | |
| 3375 | return self.m_base_instance.AbsoluteSize | |
| 3376 | end | |
| 3377 | function GuiObject:GetPosition() | |
| 3378 | return self.position | |
| 3379 | end | |
| 3380 | function GuiObject:GetSize() | |
| 3381 | return self.size | |
| 3382 | end | |
| 3383 | function GuiObject:Init() | |
| 3384 | GuiBase.Init(self) | |
| 3385 | self.mouseDown = false | |
| 3386 | self.mouseOver = false | |
| 3387 | self.DragBegin = RbxUtility.CreateSignal() | |
| 3388 | self.DragMove = RbxUtility.CreateSignal() | |
| 3389 | self.DragStopped = RbxUtility.CreateSignal() | |
| 3390 | self.MouseButton1Click = RbxUtility.CreateSignal() | |
| 3391 | self.MouseButton1Down = RbxUtility.CreateSignal() | |
| 3392 | self.MouseButton1Up = RbxUtility.CreateSignal() | |
| 3393 | self.MouseButton2Down = RbxUtility.CreateSignal() | |
| 3394 | self.MouseButton2Up = RbxUtility.CreateSignal() | |
| 3395 | self.MouseEnter = RbxUtility.CreateSignal() | |
| 3396 | self.MouseLeave = RbxUtility.CreateSignal() | |
| 3397 | end | |
| 3398 | function GuiObject:IsA(className) | |
| 3399 | return className == "GuiObject" or GuiBase.IsA(self, className) | |
| 3400 | end | |
| 3401 | function GuiObject:SetActive(active) | |
| 3402 | if active ~= self.active then | |
| 3403 | self.active = active | |
| 3404 | end | |
| 3405 | end | |
| 3406 | function GuiObject:SetBackgroundTransparency(backgroundTransparency) | |
| 3407 | if backgroundTransparency ~= self.backgroundTransparency then | |
| 3408 | self.backgroundTransparency = backgroundTransparency | |
| 3409 | self.m_base_instance.BackgroundTransparency = backgroundTransparency | |
| 3410 | end | |
| 3411 | end | |
| 3412 | function GuiObject:SetColor(color) | |
| 3413 | if color ~= self.color then | |
| 3414 | self.color = color | |
| 3415 | self.m_base_instance.BackgroundColor3 = color | |
| 3416 | end | |
| 3417 | end | |
| 3418 | function GuiObject:SetPosition(position) | |
| 3419 | if position ~= self.position then | |
| 3420 | self.position = position | |
| 3421 | self.m_base_instance.Position = position | |
| 3422 | end | |
| 3423 | end | |
| 3424 | function GuiObject:SetSize(size) | |
| 3425 | if size ~= self.size then | |
| 3426 | self.size = size | |
| 3427 | self.m_base_instance.Size = size | |
| 3428 | end | |
| 3429 | end | |
| 3430 | function GuiObject:SetVisible(visible) | |
| 3431 | if visible ~= self.visible then | |
| 3432 | self.visible = visible | |
| 3433 | self.m_base_instance.Visible = visible | |
| 3434 | end | |
| 3435 | end | |
| 3436 | function GuiObject:SetZIndex(zIndex) | |
| 3437 | local stack = {self.m_base_instance}
| |
| 3438 | repeat | |
| 3439 | local object = stack[#stack] | |
| 3440 | stack[#stack] = nil | |
| 3441 | for _, child in ipairs(object:GetChildren()) do | |
| 3442 | stack[#stack + 1] = child | |
| 3443 | end | |
| 3444 | object.ZIndex = zIndex | |
| 3445 | until #stack == 0 | |
| 3446 | end | |
| 3447 | GuiServiceClass = setmetatable({}, GuiBase)
| |
| 3448 | GuiServiceClass.__index = GuiServiceClass | |
| 3449 | function GuiServiceClass:CreateTextArea(text, font, fontSize, textColor3, textXAlignment, textYAlignment, maxWidth, minWidth) | |
| 3450 | local totalHeight = 0 | |
| 3451 | local frame = Instance.new("Frame")
| |
| 3452 | frame.BackgroundTransparency = 1 | |
| 3453 | local label = Instance.new("TextLabel")
| |
| 3454 | label.BackgroundTransparency = 1 | |
| 3455 | label.Font = font | |
| 3456 | label.FontSize = fontSize | |
| 3457 | label.TextColor3 = textColor3 | |
| 3458 | label.TextTransparency = 1 | |
| 3459 | label.TextWrapped = true | |
| 3460 | label.TextXAlignment = textXAlignment | |
| 3461 | label.TextYAlignment = textYAlignment | |
| 3462 | label.Parent = self.guiFrame | |
| 3463 | local index = 1 | |
| 3464 | while true do | |
| 3465 | local length = #text - index + 1 | |
| 3466 | if length > 1024 then | |
| 3467 | length = 1024 | |
| 3468 | local textBlock = string.sub(text, index, index + length - 1) | |
| 3469 | label.Text = textBlock | |
| 3470 | local height = 0 | |
| 3471 | local width = maxWidth | |
| 3472 | repeat | |
| 3473 | height = height + 20 | |
| 3474 | label.Size = UDim2.new(0, width, 0, height) | |
| 3475 | until label.TextFits | |
| 3476 | repeat | |
| 3477 | height = height - 1 | |
| 3478 | label.Size = UDim2.new(0, width, 0, height) | |
| 3479 | until not label.TextFits | |
| 3480 | repeat | |
| 3481 | length = length - 10 | |
| 3482 | label.Text = string.sub(text, index, index + length - 1) | |
| 3483 | until label.TextFits | |
| 3484 | repeat | |
| 3485 | length = length + 1 | |
| 3486 | label.Text = string.sub(text, index, index + length - 1) | |
| 3487 | until not label.TextFits | |
| 3488 | local overflowCharacter = string.sub(text, index + length - 1, index + length - 1) | |
| 3489 | length = length - 1 | |
| 3490 | label.Text = string.sub(text, index, index + length - 1) | |
| 3491 | if overflowCharacter == "\n" then | |
| 3492 | index = index + 1 | |
| 3493 | end | |
| 3494 | repeat | |
| 3495 | height = height - 1 | |
| 3496 | label.Size = UDim2.new(0, width, 0, height) | |
| 3497 | until not label.TextFits | |
| 3498 | height = height + 1 | |
| 3499 | local blockLabel = label:Clone() | |
| 3500 | blockLabel.Position = UDim2.new(0, 0, 0, totalHeight) | |
| 3501 | blockLabel.Size = UDim2.new(1, 0, 0, height) | |
| 3502 | blockLabel.Parent = frame | |
| 3503 | totalHeight = totalHeight + height | |
| 3504 | index = index + length | |
| 3505 | else | |
| 3506 | local textBlock = string.sub(text, index) | |
| 3507 | label.Text = textBlock | |
| 3508 | local height = 0 | |
| 3509 | local width = maxWidth | |
| 3510 | repeat | |
| 3511 | height = height + 20 | |
| 3512 | label.Size = UDim2.new(0, width, 0, height) | |
| 3513 | until label.TextFits | |
| 3514 | repeat | |
| 3515 | height = height - 1 | |
| 3516 | label.Size = UDim2.new(0, width, 0, height) | |
| 3517 | until not label.TextFits | |
| 3518 | height = height + 1 | |
| 3519 | if index == 1 then | |
| 3520 | repeat | |
| 3521 | width = width - 10 | |
| 3522 | label.Size = UDim2.new(0, width, 0, height) | |
| 3523 | until width < minWidth or not label.TextFits | |
| 3524 | width = math.max(width, minWidth - 1) | |
| 3525 | repeat | |
| 3526 | width = width + 1 | |
| 3527 | label.Size = UDim2.new(0, width, 0, height) | |
| 3528 | until label.TextFits | |
| 3529 | end | |
| 3530 | local blockLabel = label:Clone() | |
| 3531 | blockLabel.Position = UDim2.new(0, 0, 0, totalHeight) | |
| 3532 | blockLabel.Size = UDim2.new(1, 0, 0, height) | |
| 3533 | blockLabel.Parent = frame | |
| 3534 | label:Destroy() | |
| 3535 | frame.Size = UDim2.new(0, width, 0, totalHeight + height) | |
| 3536 | return frame | |
| 3537 | end | |
| 3538 | end | |
| 3539 | end | |
| 3540 | function GuiServiceClass:Destroy() | |
| 3541 | self.running = false | |
| 3542 | self.cameraPart:Destroy() | |
| 3543 | self.cameraConnection:disconnect() | |
| 3544 | self.keyDownConnection:disconnect() | |
| 3545 | self.mouseButton1DownConnection:disconnect() | |
| 3546 | self.mouseButton1UpConnection:disconnect() | |
| 3547 | self.mouseButton2DownConnection:disconnect() | |
| 3548 | self.mouseButton2UpConnection:disconnect() | |
| 3549 | self.mouseMoveConnection:disconnect() | |
| 3550 | self.steppedConnection:disconnect() | |
| 3551 | end | |
| 3552 | function GuiServiceClass:GetMousePosition() | |
| 3553 | local mouse = self.mouse | |
| 3554 | return mouse.X, mouse.Y -- mouse.X, mouse.Y + 2 -- return mouse.X - 2, mouse.Y - 3 | |
| 3555 | end | |
| 3556 | function GuiServiceClass:GetTextBounds(text, font, fontSize, alignX, alignY, width) | |
| 3557 | local tempLabel = self.tempLabel | |
| 3558 | tempLabel.Font = font | |
| 3559 | tempLabel.FontSize = fontSize | |
| 3560 | tempLabel.Size = UDim2.new(0, width, 0, 4096) | |
| 3561 | tempLabel.Text = text | |
| 3562 | tempLabel.TextXAlignment = alignX | |
| 3563 | tempLabel.TextYAlignment = alignY | |
| 3564 | local textBounds = tempLabel.TextBounds | |
| 3565 | tempLabel.Text = "" | |
| 3566 | return textBounds | |
| 3567 | end | |
| 3568 | function GuiServiceClass:Init(data) | |
| 3569 | GuiBase.Init(self) | |
| 3570 | local _ = string.char | |
| 3571 | local camera = data.Camera | |
| 3572 | local mouse = data.Mouse | |
| 3573 | local cameraPart = Instance.new("Part")
| |
| 3574 | local billboardGui = Instance.new("BillboardGui", cameraPart)
| |
| 3575 | guiFrame = Instance.new("Frame", billboardGui)
| |
| 3576 | cameraPart.Anchored = true | |
| 3577 | cameraPart.BottomSurface = "Smooth" | |
| 3578 | cameraPart.CanCollide = false | |
| 3579 | -- cameraPart.CFrame = CFrame.new(16384, 16384, 16384) | |
| 3580 | cameraPart.FormFactor = "Custom" | |
| 3581 | cameraPart.Locked = true | |
| 3582 | cameraPart.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 3583 | cameraPart.TopSurface = "Smooth" | |
| 3584 | cameraPart.Transparency = 1 | |
| 3585 | billboardGui.Adornee = cameraPart | |
| 3586 | billboardGui.AlwaysOnTop = true | |
| 3587 | -- billboardGui.ExtentsOffset = Vector3.new(-16384, -16384, -16384) | |
| 3588 | guiFrame.BackgroundTransparency = 1 | |
| 3589 | cameraPart.Parent = camera | |
| 3590 | self.running = true | |
| 3591 | self.m_base_instance = guiFrame | |
| 3592 | self.billboardGui = billboardGui | |
| 3593 | self.cameraPart = cameraPart | |
| 3594 | self.tempLabel = RBXInstance.new "TextLabel" {
| |
| 3595 | BackgroundTransparency = 1, | |
| 3596 | TextTransparency = 1, | |
| 3597 | TextWrapped = true, | |
| 3598 | Parent = guiFrame | |
| 3599 | } | |
| 3600 | self.mnemonics = {}
| |
| 3601 | self.visible = true | |
| 3602 | self.camera = camera | |
| 3603 | self.mouse = mouse | |
| 3604 | self.cameraConnection = camera.Changed:connect(function(property) | |
| 3605 | self:UpdateView() | |
| 3606 | if property == "CameraType" then | |
| 3607 | if camera.CameraType ~= Enum.CameraType.Track and camera.CameraType ~= Enum.CameraType.Fixed then | |
| 3608 | camera.CameraType = Enum.CameraType.Track | |
| 3609 | end | |
| 3610 | elseif property == "CoordinateFrame" and camera.CameraType ~= Enum.CameraType.Fixed then | |
| 3611 | local cframe, focus = camera.CoordinateFrame, camera.Focus | |
| 3612 | local watchOffset = focus.p - cframe.p | |
| 3613 | local error = watchOffset.unit - cframe.lookVector | |
| 3614 | if error.magnitude >= 1e-3 then | |
| 3615 | local head = PlayerControl.GetHead() | |
| 3616 | local time1, velocity1 | |
| 3617 | if head then | |
| 3618 | time1 = time() | |
| 3619 | velocity1 = head.Velocity | |
| 3620 | end | |
| 3621 | if camera.Changed:wait() == "CoordinateFrame" then | |
| 3622 | local position = cframe.p | |
| 3623 | if head then | |
| 3624 | local time2 = time() | |
| 3625 | local velocity2 = head.Velocity | |
| 3626 | position = position + 0.5 * (velocity1 + velocity2) * (time2 - time1) | |
| 3627 | end | |
| 3628 | camera.CoordinateFrame = CFrame.new(position, camera.Focus.p) | |
| 3629 | end | |
| 3630 | end | |
| 3631 | end | |
| 3632 | end) | |
| 3633 | self.keyDownConnection = mouse.KeyDown:connect(function(key) self:KeyDown(key) end) | |
| 3634 | self.mouseButton1DownConnection = mouse.Button1Down:connect(function() self:MouseButton1Down() end) | |
| 3635 | self.mouseButton1UpConnection = mouse.Button1Up:connect(function() self:MouseButton1Up() end) | |
| 3636 | self.mouseButton2DownConnection = mouse.Button2Down:connect(function() self:MouseButton2Down() end) | |
| 3637 | self.mouseButton2UpConnection = mouse.Button2Up:connect(function() self:MouseButton2Up() end) | |
| 3638 | self.mouseMoveConnection = mouse.Move:connect(function() self:MouseMove() end) | |
| 3639 | self.steppedConnection = RunService.RenderStepped:connect(function() self:UpdateObjects() self:UpdateView() end) | |
| 3640 | self.mousePreviousPosition = Vector2.new(self:GetMousePosition()) | |
| 3641 | end | |
| 3642 | function GuiServiceClass:IsA(className) | |
| 3643 | return className == "GuiService" or GuiBase.IsA(self, className) | |
| 3644 | end | |
| 3645 | function GuiServiceClass:KeyDown(key) | |
| 3646 | local mnemonicButton = self.mnemonics[string.upper(key)] | |
| 3647 | if mnemonicButton then | |
| 3648 | mnemonicButton.Activated:fire() | |
| 3649 | end | |
| 3650 | end | |
| 3651 | function GuiServiceClass:MouseButton1Down() | |
| 3652 | local mouse = self.mouse | |
| 3653 | local mouseX, mouseY = self:GetMousePosition() | |
| 3654 | local stack = {self}
| |
| 3655 | local dragObjects = {}
| |
| 3656 | self.dragObjects = dragObjects | |
| 3657 | while #stack > 0 do | |
| 3658 | local object = stack[#stack] | |
| 3659 | stack[#stack] = nil | |
| 3660 | if object.visible then | |
| 3661 | for child in pairs(object.children) do | |
| 3662 | stack[#stack + 1] = child | |
| 3663 | end | |
| 3664 | if object.active then | |
| 3665 | local position = object:GetAbsolutePosition() | |
| 3666 | local size = object:GetAbsoluteSize() | |
| 3667 | if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then | |
| 3668 | object.mouseDown = true | |
| 3669 | dragObjects[object] = true | |
| 3670 | local mouseButton1Down = object.MouseButton1Down | |
| 3671 | if mouseButton1Down then | |
| 3672 | mouseButton1Down:fire() | |
| 3673 | if object.autoButtonColor then | |
| 3674 | local color = object.color | |
| 3675 | local transparency = object.backgroundTransparency | |
| 3676 | object.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + | |
| 3677 | ||
| 3678 | 0.3, 1), math.min(color.b + 0.3, 1)) | |
| 3679 | object.m_base_instance.BackgroundTransparency = transparency | |
| 3680 | end | |
| 3681 | end | |
| 3682 | object.DragBegin:fire() | |
| 3683 | end | |
| 3684 | end | |
| 3685 | end | |
| 3686 | end | |
| 3687 | self.mousePreviousPosition = Vector2.new(mouseX, mouseY) | |
| 3688 | end | |
| 3689 | function GuiServiceClass:MouseButton1Up() | |
| 3690 | local mouse = self.mouse | |
| 3691 | local mouseX, mouseY = self:GetMousePosition() | |
| 3692 | local stack = {self}
| |
| 3693 | while #stack > 0 do | |
| 3694 | local object = stack[#stack] | |
| 3695 | stack[#stack] = nil | |
| 3696 | if object.visible then | |
| 3697 | for child in pairs(object.children) do | |
| 3698 | stack[#stack + 1] = child | |
| 3699 | end | |
| 3700 | if object.active then | |
| 3701 | local position = object:GetAbsolutePosition() | |
| 3702 | local size = object:GetAbsoluteSize() | |
| 3703 | if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then | |
| 3704 | object.MouseButton1Up:fire() | |
| 3705 | end | |
| 3706 | end | |
| 3707 | end | |
| 3708 | end | |
| 3709 | local dragObjects = self.dragObjects | |
| 3710 | self.dragObjects = nil | |
| 3711 | if dragObjects then | |
| 3712 | for dragObject in pairs(dragObjects) do | |
| 3713 | dragObject.mouseDown = false | |
| 3714 | local position = dragObject:GetAbsolutePosition() | |
| 3715 | local size = dragObject:GetAbsoluteSize() | |
| 3716 | if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then | |
| 3717 | dragObject.MouseButton1Click:fire() | |
| 3718 | local activated = dragObject.Activated | |
| 3719 | if activated then | |
| 3720 | activated:fire() | |
| 3721 | end | |
| 3722 | end | |
| 3723 | dragObject.DragStopped:fire() | |
| 3724 | if dragObject.autoButtonColor then | |
| 3725 | if dragObject.mouseOver then | |
| 3726 | local color = dragObject.color | |
| 3727 | local transparency = dragObject.backgroundTransparency | |
| 3728 | dragObject.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), | |
| 3729 | ||
| 3730 | math.max(color.b - 0.3, 0)) | |
| 3731 | dragObject.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.2) | |
| 3732 | else | |
| 3733 | dragObject.m_base_instance.BackgroundColor3 = dragObject.color | |
| 3734 | dragObject.m_base_instance.BackgroundTransparency = dragObject.backgroundTransparency | |
| 3735 | end | |
| 3736 | end | |
| 3737 | self.dragObject = nil | |
| 3738 | end | |
| 3739 | end | |
| 3740 | end | |
| 3741 | function GuiServiceClass:MouseButton2Down() | |
| 3742 | local mouse = self.mouse | |
| 3743 | local mouseX, mouseY = self:GetMousePosition() | |
| 3744 | local stack = {self}
| |
| 3745 | while #stack > 0 do | |
| 3746 | local object = stack[#stack] | |
| 3747 | stack[#stack] = nil | |
| 3748 | if object.visible then | |
| 3749 | for child in pairs(object.children) do | |
| 3750 | stack[#stack + 1] = child | |
| 3751 | end | |
| 3752 | if object.active then | |
| 3753 | local position = object:GetAbsolutePosition() | |
| 3754 | local size = object:GetAbsoluteSize() | |
| 3755 | if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then | |
| 3756 | local mouseButton2Down = object.MouseButton2Down | |
| 3757 | if mouseButton2Down then | |
| 3758 | mouseButton2Down:fire() | |
| 3759 | end | |
| 3760 | end | |
| 3761 | end | |
| 3762 | end | |
| 3763 | end | |
| 3764 | self.mousePreviousPosition = Vector2.new(mouseX, mouseY) | |
| 3765 | end | |
| 3766 | function GuiServiceClass:MouseButton2Up() | |
| 3767 | local mouse = self.mouse | |
| 3768 | local mouseX, mouseY = self:GetMousePosition() | |
| 3769 | local stack = {self}
| |
| 3770 | while #stack > 0 do | |
| 3771 | local object = stack[#stack] | |
| 3772 | stack[#stack] = nil | |
| 3773 | if object.visible then | |
| 3774 | for child in pairs(object.children) do | |
| 3775 | stack[#stack + 1] = child | |
| 3776 | end | |
| 3777 | if object.active then | |
| 3778 | local position = object:GetAbsolutePosition() | |
| 3779 | local size = object:GetAbsoluteSize() | |
| 3780 | if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then | |
| 3781 | local mouseButton2Up = object.MouseButton2Up | |
| 3782 | if mouseButton2Up then | |
| 3783 | mouseButton2Up:fire() | |
| 3784 | end | |
| 3785 | end | |
| 3786 | end | |
| 3787 | end | |
| 3788 | end | |
| 3789 | end | |
| 3790 | function GuiServiceClass:MouseMove() | |
| 3791 | self:UpdateObjects() | |
| 3792 | local dragObjects = self.dragObjects | |
| 3793 | if dragObjects then | |
| 3794 | for dragObject in pairs(dragObjects) do | |
| 3795 | local mouse = self.mouse | |
| 3796 | local mousePosition = Vector2.new(self:GetMousePosition()) | |
| 3797 | dragObject.DragMove:fire(mousePosition - self.mousePreviousPosition) | |
| 3798 | self.mousePreviousPosition = mousePosition | |
| 3799 | end | |
| 3800 | end | |
| 3801 | end | |
| 3802 | function GuiServiceClass:SetMnemonic(mnemonic, button) | |
| 3803 | self.mnemonics[mnemonic] = button | |
| 3804 | end | |
| 3805 | function GuiServiceClass:UpdateObjects() | |
| 3806 | local mouse = self.mouse | |
| 3807 | local mouseX, mouseY = self:GetMousePosition() | |
| 3808 | local stack = {self}
| |
| 3809 | while #stack > 0 do | |
| 3810 | local object = stack[#stack] | |
| 3811 | stack[#stack] = nil | |
| 3812 | if object.visible then | |
| 3813 | for child in pairs(object.children) do | |
| 3814 | stack[#stack + 1] = child | |
| 3815 | end | |
| 3816 | if object.active then | |
| 3817 | local position = object:GetAbsolutePosition() | |
| 3818 | local size = object:GetAbsoluteSize() | |
| 3819 | if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then | |
| 3820 | if not object.mouseOver then | |
| 3821 | object.mouseOver = true | |
| 3822 | object.MouseEnter:fire() | |
| 3823 | if object.autoButtonColor then | |
| 3824 | local color = object.color | |
| 3825 | local transparency = object.backgroundTransparency | |
| 3826 | if object.mouseDown then | |
| 3827 | object.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + 0.3, 1), math.min(color.b + 0.3, 1)) | |
| 3828 | object.m_base_instance.BackgroundTransparency = transparency | |
| 3829 | else | |
| 3830 | object.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), math.max(color.b - 0.3, 0)) | |
| 3831 | object.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.2) | |
| 3832 | end | |
| 3833 | end | |
| 3834 | end | |
| 3835 | else | |
| 3836 | if object.mouseOver then | |
| 3837 | object.mouseOver = false | |
| 3838 | object.MouseLeave:fire() | |
| 3839 | if object.autoButtonColor then | |
| 3840 | object.m_base_instance.BackgroundColor3 = object.color | |
| 3841 | object.m_base_instance.BackgroundTransparency = object.backgroundTransparency | |
| 3842 | end | |
| 3843 | end | |
| 3844 | end | |
| 3845 | end | |
| 3846 | end | |
| 3847 | end | |
| 3848 | end | |
| 3849 | function GuiServiceClass:UpdateView() | |
| 3850 | local billboardGui = self.billboardGui | |
| 3851 | local guiFrame = self.m_base_instance | |
| 3852 | local camera = self.camera | |
| 3853 | local mouse = self.mouse | |
| 3854 | local cameraCFrame = CFrame.new(camera.CoordinateFrame.p, camera.Focus.p) -- camera.CoordinateFrame | |
| 3855 | local viewSizeX, viewSizeY = mouse.ViewSizeX, mouse.ViewSizeY | |
| 3856 | local previousViewSize = self.viewSize | |
| 3857 | if not previousViewSize or ((viewSizeX ~= 0 or viewSizeY ~= 0) and (viewSizeX ~= previousViewSize.X or viewSizeY ~= previousViewSize.Y)) then | |
| 3858 | self.viewSize = {X = viewSizeX, Y = viewSizeY}
| |
| 3859 | local viewSizeUDim2 = UDim2.new(0, viewSizeX, 0, viewSizeY) | |
| 3860 | billboardGui.Size = viewSizeUDim2 | |
| 3861 | guiFrame.Size = viewSizeUDim2 | |
| 3862 | -- FIXME: | |
| 3863 | -- After the 15th of July 2014, there came an offset at the Y thingy out of nowhere so I accomodated for that. | |
| 3864 | billboardGui.SizeOffset = Vector2.new(0.5 / viewSizeX, (0.5 + 10) / viewSizeY) | |
| 3865 | end | |
| 3866 | --billboardGui.SizeOffset = Vector2.new() | |
| 3867 | billboardGui.StudsOffset = (cameraCFrame - cameraCFrame.p):inverse() * cameraCFrame.p - Vector3.new(0, 0, 1) | |
| 3868 | end | |
| 3869 | GuiService = GuiServiceClass:new {
| |
| 3870 | Camera = Camera, | |
| 3871 | Mouse = Mouse | |
| 3872 | } | |
| 3873 | GuiFrame = setmetatable({}, GuiObject)
| |
| 3874 | GuiFrame.__index = GuiFrame | |
| 3875 | GuiFrame.__default = {__index = {
| |
| 3876 | Active = false, | |
| 3877 | BackgroundTransparency = 0.75, | |
| 3878 | BorderSize = 4, | |
| 3879 | BorderTransparency = 0.75, | |
| 3880 | Color = AdvancedGUI.GUI_BASE_COLOR, | |
| 3881 | Position = UDim2.new(0, 0, 0, 0), | |
| 3882 | Size = UDim2.new(0, 52, 0, 52), | |
| 3883 | Visible = true | |
| 3884 | }} | |
| 3885 | function GuiFrame:Destroy() | |
| 3886 | GuiObject.Destroy(self) | |
| 3887 | end | |
| 3888 | function GuiFrame:GetContentInstance() | |
| 3889 | return self.m_content_frame | |
| 3890 | end | |
| 3891 | function GuiFrame:Init(data) | |
| 3892 | GuiObject.Init(self) | |
| 3893 | setmetatable(data, GuiFrame.__default) | |
| 3894 | local leftBorderFrameLeft = RBXInstance.new "Frame" {
| |
| 3895 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 3896 | BorderSizePixel = 0, | |
| 3897 | Size = UDim2.new(0, 1, 1, -1) | |
| 3898 | } | |
| 3899 | local leftBorderFrameCenter = RBXInstance.new "Frame" {
| |
| 3900 | BackgroundColor3 = Color3.new(1, 1, 1), | |
| 3901 | BorderSizePixel = 0, | |
| 3902 | Position = UDim2.new(0, 1, 0, 1) | |
| 3903 | } | |
| 3904 | local leftBorderFrameRight = RBXInstance.new "Frame" {
| |
| 3905 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 3906 | BorderSizePixel = 0 | |
| 3907 | } | |
| 3908 | local rightBorderFrameRight = RBXInstance.new "Frame" {
| |
| 3909 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 3910 | BorderSizePixel = 0, | |
| 3911 | Position = UDim2.new(1, -1, 0, 1), | |
| 3912 | Size = UDim2.new(0, 1, 1, -1) | |
| 3913 | } | |
| 3914 | local rightBorderFrameCenter = RBXInstance.new "Frame" {
| |
| 3915 | BackgroundColor3 = Color3.new(1, 1, 1), | |
| 3916 | BorderSizePixel = 0 | |
| 3917 | } | |
| 3918 | local rightBorderFrameLeft = RBXInstance.new "Frame" {
| |
| 3919 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 3920 | BorderSizePixel = 0 | |
| 3921 | } | |
| 3922 | local bottomBorderFrameBottom = RBXInstance.new "Frame" {
| |
| 3923 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 3924 | BorderSizePixel = 0, | |
| 3925 | Position = UDim2.new(0, 0, 1, -1), | |
| 3926 | Size = UDim2.new(1, -1, 0, 1) | |
| 3927 | } | |
| 3928 | local bottomBorderFrameCenter = RBXInstance.new "Frame" {
| |
| 3929 | BackgroundColor3 = Color3.new(1, 1, 1), | |
| 3930 | BorderSizePixel = 0 | |
| 3931 | } | |
| 3932 | local bottomBorderFrameTop = RBXInstance.new "Frame" {
| |
| 3933 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 3934 | BorderSizePixel = 0 | |
| 3935 | } | |
| 3936 | local topBorderFrameTop = RBXInstance.new "Frame" {
| |
| 3937 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 3938 | BorderSizePixel = 0, | |
| 3939 | Position = UDim2.new(0, 1, 0, 0), | |
| 3940 | Size = UDim2.new(1, -1, 0, 1) | |
| 3941 | } | |
| 3942 | local topBorderFrameCenter = RBXInstance.new "Frame" {
| |
| 3943 | BackgroundColor3 = Color3.new(1, 1, 1), | |
| 3944 | BorderSizePixel = 0 | |
| 3945 | } | |
| 3946 | local topBorderFrameBottom = RBXInstance.new "Frame" {
| |
| 3947 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 3948 | BorderSizePixel = 0 | |
| 3949 | } | |
| 3950 | local border_frame = RBXInstance.new "Frame" {
| |
| 3951 | BackgroundTransparency = 1, | |
| 3952 | Size = UDim2.new(1, 0, 1, 0), | |
| 3953 | leftBorderFrameLeft, | |
| 3954 | leftBorderFrameCenter, | |
| 3955 | leftBorderFrameRight, | |
| 3956 | rightBorderFrameLeft, | |
| 3957 | rightBorderFrameCenter, | |
| 3958 | rightBorderFrameRight, | |
| 3959 | bottomBorderFrameBottom, | |
| 3960 | bottomBorderFrameCenter, | |
| 3961 | bottomBorderFrameTop, | |
| 3962 | topBorderFrameBottom, | |
| 3963 | topBorderFrameCenter, | |
| 3964 | topBorderFrameTop | |
| 3965 | } | |
| 3966 | local contentFrame = RBXInstance.new "Frame" {
| |
| 3967 | BackgroundTransparency = 1, | |
| 3968 | BorderSizePixel = 0, | |
| 3969 | ClipsDescendants = true, | |
| 3970 | Size = UDim2.new(1, 0, 1, 0) | |
| 3971 | } | |
| 3972 | local base_frame = RBXInstance.new "Frame" {
| |
| 3973 | BorderSizePixel = 0, | |
| 3974 | border_frame, | |
| 3975 | contentFrame | |
| 3976 | } | |
| 3977 | self.m_base_instance = base_frame | |
| 3978 | self.m_content_frame = contentFrame | |
| 3979 | self.m_border_frame = border_frame | |
| 3980 | self.leftBorderFrameLeft = leftBorderFrameLeft | |
| 3981 | self.leftBorderFrameCenter = leftBorderFrameCenter | |
| 3982 | self.leftBorderFrameRight = leftBorderFrameRight | |
| 3983 | self.rightBorderFrameLeft = rightBorderFrameLeft | |
| 3984 | self.rightBorderFrameCenter = rightBorderFrameCenter | |
| 3985 | self.rightBorderFrameRight = rightBorderFrameRight | |
| 3986 | self.bottomBorderFrameBottom = bottomBorderFrameBottom | |
| 3987 | self.bottomBorderFrameCenter = bottomBorderFrameCenter | |
| 3988 | self.bottomBorderFrameTop = bottomBorderFrameTop | |
| 3989 | self.topBorderFrameBottom = topBorderFrameBottom | |
| 3990 | self.topBorderFrameCenter = topBorderFrameCenter | |
| 3991 | self.topBorderFrameTop = topBorderFrameTop | |
| 3992 | self:SetActive(data.Active) | |
| 3993 | self:SetBackgroundTransparency(data.BackgroundTransparency) | |
| 3994 | self:SetBorderSize(data.BorderSize) | |
| 3995 | self:SetBorderTransparency(data.BorderTransparency) | |
| 3996 | self:SetColor(data.Color) | |
| 3997 | self:SetPosition(data.Position) | |
| 3998 | self:SetSize(data.Size) | |
| 3999 | self:SetVisible(data.Visible) | |
| 4000 | self:SetParent(data.Parent) | |
| 4001 | end | |
| 4002 | function GuiFrame:IsA(className) | |
| 4003 | return className == "GuiFrame" or GuiObject.IsA(self, className) | |
| 4004 | end | |
| 4005 | function GuiFrame:SetBorderSize(border_size) | |
| 4006 | border_size = math.max(math.floor(border_size + 0.5), 0) | |
| 4007 | if border_size ~= self.m_border_size then | |
| 4008 | self.m_border_size = border_size | |
| 4009 | local border_frame = self.m_border_frame | |
| 4010 | local contentFrame = self.m_content_frame | |
| 4011 | local leftBorderFrameCenter = self.leftBorderFrameCenter | |
| 4012 | local leftBorderFrameRight = self.leftBorderFrameRight | |
| 4013 | local rightBorderFrameCenter = self.rightBorderFrameCenter | |
| 4014 | local rightBorderFrameLeft = self.rightBorderFrameLeft | |
| 4015 | local bottomBorderFrameCenter = self.bottomBorderFrameCenter | |
| 4016 | local bottomBorderFrameTop = self.bottomBorderFrameTop | |
| 4017 | local topBorderFrameCenter = self.topBorderFrameCenter | |
| 4018 | local topBorderFrameBottom = self.topBorderFrameBottom | |
| 4019 | contentFrame.Position = UDim2.new(0, border_size, 0, border_size) | |
| 4020 | contentFrame.Size = UDim2.new(1, -2 * border_size, 1, -2 * border_size) | |
| 4021 | local inner_visible = border_size > 0 | |
| 4022 | if self.leftBorderFrameLeft.Visible ~= inner_visible then | |
| 4023 | self.rightBorderFrameRight.Visible = inner_visible | |
| 4024 | self.bottomBorderFrameBottom.Visible = inner_visible | |
| 4025 | self.topBorderFrameTop.Visible = inner_visible | |
| 4026 | end | |
| 4027 | local outer_visible = border_size > 1 | |
| 4028 | if leftBorderFrameCenter.Visible ~= outer_visible then | |
| 4029 | leftBorderFrameCenter.Visible = outer_visible | |
| 4030 | leftBorderFrameRight.Visible = outer_visible | |
| 4031 | rightBorderFrameCenter.Visible = outer_visible | |
| 4032 | rightBorderFrameLeft.Visible = outer_visible | |
| 4033 | bottomBorderFrameCenter.Visible = outer_visible | |
| 4034 | bottomBorderFrameTop.Visible = outer_visible | |
| 4035 | topBorderFrameCenter.Visible = outer_visible | |
| 4036 | topBorderFrameBottom.Visible = outer_visible | |
| 4037 | end | |
| 4038 | if outer_visible then | |
| 4039 | leftBorderFrameCenter.Size = UDim2.new(0, border_size - 2, 1, -border_size) | |
| 4040 | leftBorderFrameRight.Position = UDim2.new(0, border_size - 1, 0, border_size - 1) | |
| 4041 | leftBorderFrameRight.Size = UDim2.new(0, 1, 1, 1 - 2 * border_size) | |
| 4042 | rightBorderFrameCenter.Position = UDim2.new(1, 1 - border_size, 0, border_size - 1) | |
| 4043 | rightBorderFrameCenter.Size = UDim2.new(0, border_size - 2, 1, -border_size) | |
| 4044 | rightBorderFrameLeft.Position = UDim2.new(1, -border_size, 0, border_size) | |
| 4045 | rightBorderFrameLeft.Size = UDim2.new(0, 1, 1, 1 - 2 * border_size) | |
| 4046 | bottomBorderFrameCenter.Position = UDim2.new(0, 1, 1, 1 - border_size) | |
| 4047 | bottomBorderFrameCenter.Size = UDim2.new(1, -border_size, 0, border_size - 2) | |
| 4048 | bottomBorderFrameTop.Position = UDim2.new(0, border_size - 1, 1, -border_size) | |
| 4049 | bottomBorderFrameTop.Size = UDim2.new(1, 1 - 2 * border_size, 0, 1) | |
| 4050 | topBorderFrameCenter.Position = UDim2.new(0, border_size - 1, 0, 1) | |
| 4051 | topBorderFrameCenter.Size = UDim2.new(1, -border_size, 0, border_size - 2) | |
| 4052 | topBorderFrameBottom.Position = UDim2.new(0, border_size, 0, border_size - 1) | |
| 4053 | topBorderFrameBottom.Size = UDim2.new(1, 1 - 2 * border_size, 0, 1) | |
| 4054 | end | |
| 4055 | end | |
| 4056 | end | |
| 4057 | function GuiFrame:SetBorderTransparency(borderTransparency) | |
| 4058 | self.borderTransparency = borderTransparency | |
| 4059 | self.leftBorderFrameLeft.BackgroundTransparency = borderTransparency | |
| 4060 | self.leftBorderFrameCenter.BackgroundTransparency = borderTransparency | |
| 4061 | self.leftBorderFrameRight.BackgroundTransparency = borderTransparency | |
| 4062 | self.rightBorderFrameLeft.BackgroundTransparency = borderTransparency | |
| 4063 | self.rightBorderFrameCenter.BackgroundTransparency = borderTransparency | |
| 4064 | self.rightBorderFrameRight.BackgroundTransparency = borderTransparency | |
| 4065 | self.bottomBorderFrameBottom.BackgroundTransparency = borderTransparency | |
| 4066 | self.bottomBorderFrameCenter.BackgroundTransparency = borderTransparency | |
| 4067 | self.bottomBorderFrameTop.BackgroundTransparency = borderTransparency | |
| 4068 | self.topBorderFrameBottom.BackgroundTransparency = borderTransparency | |
| 4069 | self.topBorderFrameCenter.BackgroundTransparency = borderTransparency | |
| 4070 | self.topBorderFrameTop.BackgroundTransparency = borderTransparency | |
| 4071 | end | |
| 4072 | GuiButton = setmetatable({}, GuiFrame)
| |
| 4073 | GuiButton.__index = GuiButton | |
| 4074 | GuiButton.__default = {__index = {
| |
| 4075 | AutoButtonColor = true | |
| 4076 | }} | |
| 4077 | function GuiButton:Destroy() | |
| 4078 | self.Activated:disconnect() | |
| 4079 | GuiFrame.Destroy(self) | |
| 4080 | end | |
| 4081 | function GuiButton:Init(data) | |
| 4082 | if data.Active == nil then | |
| 4083 | data.Active = true | |
| 4084 | end | |
| 4085 | GuiFrame.Init(self, data) | |
| 4086 | setmetatable(data, GuiButton.__default) | |
| 4087 | self.Activated = RbxUtility.CreateSignal() | |
| 4088 | self:SetAutoButtonColor(data.AutoButtonColor) | |
| 4089 | end | |
| 4090 | function GuiButton:IsA(className) | |
| 4091 | return className == "GuiButton" or GuiFrame.IsA(self, className) | |
| 4092 | end | |
| 4093 | function GuiButton:SetAutoButtonColor(autoButtonColor) | |
| 4094 | if autoButtonColor ~= self.autoButtonColor then | |
| 4095 | self.autoButtonColor = autoButtonColor | |
| 4096 | if autoButtonColor then | |
| 4097 | if self.mouseOver then | |
| 4098 | local color = self.color | |
| 4099 | local transparency = self.backgroundTransparency | |
| 4100 | if self.mouseDown then | |
| 4101 | self.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + 0.3, 1), math.min(color.b + 0.3, 1)) | |
| 4102 | self.m_base_instance.BackgroundTransparency = transparency | |
| 4103 | else | |
| 4104 | self.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), math.max(color.b - 0.3, 0)) | |
| 4105 | self.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.5) | |
| 4106 | end | |
| 4107 | end | |
| 4108 | else | |
| 4109 | self.m_base_instance.BackgroundColor3 = self.color | |
| 4110 | end | |
| 4111 | end | |
| 4112 | end | |
| 4113 | GuiTextLabel = setmetatable({}, GuiFrame)
| |
| 4114 | GuiTextLabel.__index = GuiTextLabel | |
| 4115 | GuiTextLabel.__default = {__index = {
| |
| 4116 | Font = "ArialBold", | |
| 4117 | FontSize = "Size12", | |
| 4118 | Text = "", | |
| 4119 | TextColor = Color3.new(1, 1, 1), | |
| 4120 | TextStrokeColor = Color3.new(0, 0, 0), | |
| 4121 | TextStrokeTransparency = 0.6, | |
| 4122 | TextWrapped = true | |
| 4123 | }} | |
| 4124 | function GuiTextLabel:Destroy() | |
| 4125 | GuiFrame.Destroy(self) | |
| 4126 | end | |
| 4127 | function GuiTextLabel:Init(data) | |
| 4128 | GuiFrame.Init(self, data) | |
| 4129 | setmetatable(data, GuiTextLabel.__default) | |
| 4130 | local base_instance = self.m_base_instance | |
| 4131 | local textLabel = RBXInstance.new "TextLabel" {
| |
| 4132 | BackgroundTransparency = 1, | |
| 4133 | Font = data.Font, | |
| 4134 | FontSize = data.FontSize, | |
| 4135 | TextColor3 = data.TextColor3, | |
| 4136 | TextStrokeColor3 = data.TextStrokeColor3, | |
| 4137 | TextStrokeTransparency = data.TextStrokeTransparency, | |
| 4138 | TextWrapped = data.TextWrapped | |
| 4139 | } | |
| 4140 | textLabel.Parent = self:GetContentInstance() | |
| 4141 | self.textLabel = textLabel | |
| 4142 | self:SetText(data.Text) | |
| 4143 | end | |
| 4144 | function GuiTextLabel:IsA(className) | |
| 4145 | return className == "GuiTextLabel" or GuiFrame.IsA(self, className) | |
| 4146 | end | |
| 4147 | function GuiTextLabel:SetText(text) | |
| 4148 | if text ~= self.text then | |
| 4149 | self.text = text | |
| 4150 | local text_index = 1 | |
| 4151 | local content_instance = self:GetContentInstance() | |
| 4152 | local content_instance_size = content_instance.AbsoluteSize | |
| 4153 | local frame = Instance.new("Frame")
| |
| 4154 | frame.BackgroundTransparency = 1 | |
| 4155 | local label = Instance.new("TextLabel")
| |
| 4156 | label.BackgroundTransparency = 1 | |
| 4157 | label.Font = font | |
| 4158 | label.FontSize = fontSize | |
| 4159 | label.Size = UDim2.new(0, content_instance_size.X, 0, 1000) | |
| 4160 | label.Text = "" | |
| 4161 | label.TextColor3 = textColor3 | |
| 4162 | label.TextTransparency = 1 | |
| 4163 | label.TextWrapped = true | |
| 4164 | label.TextXAlignment = textXAlignment | |
| 4165 | label.TextYAlignment = textYAlignment | |
| 4166 | label.Parent = self.guiFrame | |
| 4167 | local row_length = 0 | |
| 4168 | local step_size = 256 | |
| 4169 | for step = 1, 8 do | |
| 4170 | step_size = 0.5 * step_size | |
| 4171 | label.Text = string.sub(text, text_index, text_index + row_length - 1) | |
| 4172 | end | |
| 4173 | end | |
| 4174 | end | |
| 4175 | GuiImageButton = setmetatable({}, GuiButton)
| |
| 4176 | GuiImageButton.__index = GuiImageButton | |
| 4177 | GuiImageButton.__default = {__index = {
| |
| 4178 | Image = "" | |
| 4179 | }} | |
| 4180 | function GuiImageButton:Destroy() | |
| 4181 | GuiButton.Destroy(self) | |
| 4182 | end | |
| 4183 | function GuiImageButton:Init(data) | |
| 4184 | GuiButton.Init(self, data) | |
| 4185 | setmetatable(data, GuiImageButton.__default) | |
| 4186 | local content_frame = self.m_content_frame | |
| 4187 | local image_label = RBXInstance.new "ImageLabel" {
| |
| 4188 | BackgroundTransparency = 1, | |
| 4189 | Size = UDim2.new(1, 0, 1, 0) | |
| 4190 | } | |
| 4191 | image_label.Parent = content_frame | |
| 4192 | self.m_image_label = image_label | |
| 4193 | self:SetImage(data.Image) | |
| 4194 | end | |
| 4195 | function GuiImageButton:IsA(className) | |
| 4196 | return className == "GuiImageButton" or GuiButton.IsA(self, className) | |
| 4197 | end | |
| 4198 | function GuiImageButton:SetImage(image) | |
| 4199 | if image ~= self.m_image then | |
| 4200 | self.m_image = image | |
| 4201 | self.m_image_label.Image = image | |
| 4202 | end | |
| 4203 | end | |
| 4204 | GuiTextButton = setmetatable({}, GuiButton)
| |
| 4205 | GuiTextButton.__index = GuiTextButton | |
| 4206 | GuiTextButton.__default = {__index = {
| |
| 4207 | Font = Enum.Font.ArialBold, | |
| 4208 | FontSize = Enum.FontSize.Size11, | |
| 4209 | Text = "Button", | |
| 4210 | TextXAlignment = Enum.TextXAlignment.Center | |
| 4211 | }} | |
| 4212 | function GuiTextButton:Destroy() | |
| 4213 | GuiButton.Destroy(self) | |
| 4214 | end | |
| 4215 | function GuiTextButton:GetTextBounds() | |
| 4216 | return self.textLabel.TextBounds | |
| 4217 | end | |
| 4218 | function GuiTextButton:Init(data) | |
| 4219 | GuiButton.Init(self, data) | |
| 4220 | setmetatable(data, GuiTextButton.__default) | |
| 4221 | local contentFrame = self.m_content_frame | |
| 4222 | local mnemonicLabel = RBXInstance.new "TextLabel" {
| |
| 4223 | BackgroundTransparency = 1, | |
| 4224 | Font = "ArialBold", | |
| 4225 | FontSize = "Size36", | |
| 4226 | Size = UDim2.new(1, 0, 0.7, 0), | |
| 4227 | TextColor3 = Color3.new(1, 1, 1), | |
| 4228 | TextStrokeColor3 = Color3.new(0, 0, 0), | |
| 4229 | TextStrokeTransparency = 0.6, | |
| 4230 | TextWrapped = true | |
| 4231 | } | |
| 4232 | local textLabel = RBXInstance.new "TextLabel" {
| |
| 4233 | BackgroundTransparency = 1, | |
| 4234 | TextColor3 = Color3.new(1, 1, 1), | |
| 4235 | TextStrokeColor3 = Color3.new(0, 0, 0), | |
| 4236 | TextStrokeTransparency = 0.6, | |
| 4237 | TextWrapped = true | |
| 4238 | } | |
| 4239 | mnemonicLabel.Parent = contentFrame | |
| 4240 | textLabel.Parent = contentFrame | |
| 4241 | self.mnemonicLabel = mnemonicLabel | |
| 4242 | self.textLabel = textLabel | |
| 4243 | self:SetFont(data.Font) | |
| 4244 | self:SetFontSize(data.FontSize) | |
| 4245 | self:SetMnemonic(data.Mnemonic, true) | |
| 4246 | self:SetText(data.Text) | |
| 4247 | self:SetTextXAlignment(data.TextXAlignment) | |
| 4248 | end | |
| 4249 | function GuiTextButton:IsA(className) | |
| 4250 | return className == "GuiTextButton" or GuiButton.IsA(self, className) | |
| 4251 | end | |
| 4252 | function GuiTextButton:SetFont(font) | |
| 4253 | if font ~= self.font then | |
| 4254 | self.font = font | |
| 4255 | self.textLabel.Font = font | |
| 4256 | end | |
| 4257 | end | |
| 4258 | function GuiTextButton:SetFontSize(fontSize) | |
| 4259 | if fontSize ~= self.fontSize then | |
| 4260 | self.fontSize = fontSize | |
| 4261 | self.textLabel.FontSize = fontSize | |
| 4262 | end | |
| 4263 | end | |
| 4264 | function GuiTextButton:SetMnemonic(mnemonic, forceUpdate) | |
| 4265 | if mnemonic ~= self.mnemonic or forceUpdate then | |
| 4266 | if self.mnemonic then | |
| 4267 | GuiService:SetMnemonic(self.mnemonic, nil) | |
| 4268 | end | |
| 4269 | if mnemonic then | |
| 4270 | GuiService:SetMnemonic(mnemonic, self) | |
| 4271 | end | |
| 4272 | self.mnemonic = mnemonic | |
| 4273 | local mnemonicLabel = self.mnemonicLabel | |
| 4274 | local textLabel = self.textLabel | |
| 4275 | if mnemonic then | |
| 4276 | mnemonicLabel.Text = mnemonic | |
| 4277 | textLabel.Size = UDim2.new(1, 0, 0.9, 0) | |
| 4278 | textLabel.TextYAlignment = "Bottom" | |
| 4279 | else | |
| 4280 | mnemonicLabel.Text = "" | |
| 4281 | textLabel.Size = UDim2.new(1, 0, 1, 0) | |
| 4282 | textLabel.TextYAlignment = "Center" | |
| 4283 | end | |
| 4284 | end | |
| 4285 | end | |
| 4286 | function GuiTextButton:SetText(text) | |
| 4287 | if text ~= self.text then | |
| 4288 | self.text = text | |
| 4289 | self.textLabel.Text = text | |
| 4290 | end | |
| 4291 | end | |
| 4292 | function GuiTextButton:SetTextXAlignment(textXAlignment) | |
| 4293 | if textXAlignment ~= self.textXAlignment then | |
| 4294 | self.textXAlignment = textXAlignment | |
| 4295 | self.textLabel.TextXAlignment = textXAlignment | |
| 4296 | end | |
| 4297 | end | |
| 4298 | GuiWindow = setmetatable({}, GuiObject)
| |
| 4299 | GuiWindow.__index = GuiWindow | |
| 4300 | GuiWindow.__default = {__index = {
| |
| 4301 | Active = true, | |
| 4302 | BackgroundTransparency = 0.5, | |
| 4303 | BorderSize = 4, | |
| 4304 | BorderTransparency = 0.5, | |
| 4305 | Position = UDim2.new(0, 0, 0, 0), | |
| 4306 | Size = UDim2.new(0, 360, 0, 240), | |
| 4307 | Title = "Window", | |
| 4308 | TitleBarBackgroundTransparency = 0.5, | |
| 4309 | TitleBarBorderTransparency = 1, | |
| 4310 | Visible = true | |
| 4311 | }} | |
| 4312 | function GuiWindow:Init(data) | |
| 4313 | GuiObject.Init(self) | |
| 4314 | setmetatable(data, GuiFrame.__default) | |
| 4315 | local title_bar = GuiTextLabel:new {
| |
| 4316 | BackgroundTransparency = data.TitleBarBackgroundTransparency, | |
| 4317 | BorderTransparency = data.TitleBarBackgroundTransparency, | |
| 4318 | Text = data.Title | |
| 4319 | } | |
| 4320 | local content_frame = GuiFrame:new {
| |
| 4321 | Active = data.Active, | |
| 4322 | BackgroundTransparency = data.BackgroundTransparency, | |
| 4323 | BorderSize = data.BorderSize, | |
| 4324 | BorderTransparency = data.BorderTransparency | |
| 4325 | } | |
| 4326 | local base_frame = RBXInstance.new "Frame" {
| |
| 4327 | BackgroundTransparency = 1, | |
| 4328 | BorderSizePixel = 0, | |
| 4329 | Position = data.Position, | |
| 4330 | Size = data.Size, | |
| 4331 | Visible = data.Visible | |
| 4332 | } | |
| 4333 | self.m_base_frame = base_frame | |
| 4334 | self.m_content_frame = content_frame | |
| 4335 | self.m_title_bar = title_bar | |
| 4336 | end | |
| 4337 | function GuiWindow:IsA(className) | |
| 4338 | return className == "GuiWindow" or GuiObject.IsA(self, className) | |
| 4339 | end | |
| 4340 | GuiScrollFrame = setmetatable({}, GuiFrame)
| |
| 4341 | GuiScrollFrame.__index = GuiScrollFrame | |
| 4342 | GuiScrollFrame.__default = {__index = {
| |
| 4343 | ContentHeight = 0, | |
| 4344 | ScrollBarColor = Color3.new(1, 1, 1) | |
| 4345 | }} | |
| 4346 | function GuiScrollFrame:Destroy() | |
| 4347 | self.m_scroll_bar:Destroy() | |
| 4348 | GuiFrame.Destroy(self) | |
| 4349 | end | |
| 4350 | function GuiScrollFrame:GetContentInstance() | |
| 4351 | return self.m_scroll_frame or GuiFrame.GetContentInstance(self) | |
| 4352 | end | |
| 4353 | function GuiScrollFrame:Init(data) | |
| 4354 | GuiFrame.Init(self, data) | |
| 4355 | setmetatable(data, GuiScrollFrame.__default) | |
| 4356 | local scroll_pane = RBXInstance.new "Frame" {
| |
| 4357 | BackgroundColor3 = Color3.new(1, 1, 1), | |
| 4358 | BackgroundTransparency = 0.8, | |
| 4359 | BorderSizePixel = 0, | |
| 4360 | Position = UDim2.new(1, -20, 0, 0), | |
| 4361 | Size = UDim2.new(0, 20, 1, 0), | |
| 4362 | Parent = self.m_content_frame | |
| 4363 | } | |
| 4364 | local scroll_bar = GuiFrame:new {
| |
| 4365 | Active = true, | |
| 4366 | BackgroundTransparency = 0.6, | |
| 4367 | BorderTransparency = 0.6, | |
| 4368 | Color = data.ScrollBarColor, | |
| 4369 | Parent = self | |
| 4370 | } | |
| 4371 | local scroll_frame = RBXInstance.new "Frame" {
| |
| 4372 | BackgroundTransparency = 1, | |
| 4373 | Parent = self.m_content_frame | |
| 4374 | } | |
| 4375 | self.m_scroll_bar = scroll_bar | |
| 4376 | self.m_scroll_frame = scroll_frame | |
| 4377 | self.m_scroll_pane = scroll_pane | |
| 4378 | self.m_scroll_position = 0 | |
| 4379 | self.m_updating_content_height = false | |
| 4380 | self:SetContentHeight(data.ContentHeight) | |
| 4381 | self:UpdateScrollPosition() | |
| 4382 | self.m_scroll_bar.DragBegin:connect(function() | |
| 4383 | self.m_scroll_drag_total = Vector2.new() | |
| 4384 | self.m_scroll_initial_position = self.m_scroll_position | |
| 4385 | end) | |
| 4386 | self.m_scroll_bar.DragMove:connect(function(offset) | |
| 4387 | self.m_scroll_drag_total = self.m_scroll_drag_total + offset | |
| 4388 | local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size | |
| 4389 | if absolute_height ~= 0 then | |
| 4390 | local content_height = math.max(self.m_content_height, absolute_height) | |
| 4391 | local scroll_space = 1 - absolute_height / content_height | |
| 4392 | self:Scroll(self.m_scroll_initial_position + self.m_scroll_drag_total.Y * (content_height / absolute_height - 1) / scroll_space) | |
| 4393 | end | |
| 4394 | end) | |
| 4395 | end | |
| 4396 | function GuiScrollFrame:IsA(className) | |
| 4397 | return className == "GuiScrollFrame" or GuiFrame.IsA(self, className) | |
| 4398 | end | |
| 4399 | function GuiScrollFrame:Scroll(position) | |
| 4400 | position = math.min(math.max(position, 0), self.m_content_height - (self:GetAbsoluteSize().Y - 2 * self.m_border_size)) | |
| 4401 | if position ~= self.m_scroll_position then | |
| 4402 | self.m_scroll_position = position | |
| 4403 | self:UpdateScrollPosition() | |
| 4404 | end | |
| 4405 | end | |
| 4406 | function GuiScrollFrame:SetContentHeight(height) | |
| 4407 | if height ~= self.m_content_height then | |
| 4408 | local prev_height = self.m_content_height | |
| 4409 | self.m_content_height = height | |
| 4410 | if not self.m_updating_content_height then | |
| 4411 | self.m_updating_content_height = true | |
| 4412 | coroutine.resume(coroutine.create(function() | |
| 4413 | local success, message = ypcall(self.SetContentHeightImpl1, self, prev_height) | |
| 4414 | if not success then | |
| 4415 | Logger.printf("Severe", "Error in GuiScrollFrame:SetContentHeight(%s): %s", Utility.ToString(height), message)
| |
| 4416 | end | |
| 4417 | end)) | |
| 4418 | end | |
| 4419 | end | |
| 4420 | end | |
| 4421 | function GuiScrollFrame:SetContentHeightImpl1(prev_height) | |
| 4422 | RunService.RenderStepped:wait() | |
| 4423 | self.m_updating_content_height = false | |
| 4424 | local height = self.m_content_height | |
| 4425 | self.m_scroll_frame.Size = UDim2.new(1, -20, 0, height) | |
| 4426 | if prev_height and prev_height ~= 0 then | |
| 4427 | local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size | |
| 4428 | if self.m_scroll_position == prev_height - absolute_height then | |
| 4429 | self.m_scroll_position = height - absolute_height | |
| 4430 | else | |
| 4431 | self.m_scroll_position = height * self.m_scroll_position / prev_height | |
| 4432 | end | |
| 4433 | end | |
| 4434 | self:UpdateScrollPosition() | |
| 4435 | end | |
| 4436 | function GuiScrollFrame:UpdateScrollPosition() | |
| 4437 | local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size | |
| 4438 | if absolute_height == 0 then | |
| 4439 | absolute_height = self.m_content_height | |
| 4440 | end | |
| 4441 | local scroll_bar = self.m_scroll_bar | |
| 4442 | local scroll_frame = self.m_scroll_frame | |
| 4443 | local scroll_pane = self.m_scroll_pane | |
| 4444 | local content_height = math.max(self.m_content_height, absolute_height) | |
| 4445 | if absolute_height == content_height then | |
| 4446 | scroll_frame.Position = UDim2.new(0, 0, 0, 0) | |
| 4447 | scroll_frame.Size = UDim2.new(1, 0, 1, 0) | |
| 4448 | scroll_bar:SetVisible(false) | |
| 4449 | scroll_pane.Visible = false | |
| 4450 | else | |
| 4451 | local contentScale = content_height / absolute_height | |
| 4452 | local scroll_space = 1 - absolute_height / content_height | |
| 4453 | local scroll_position = self.m_scroll_position | |
| 4454 | scroll_frame.Position = UDim2.new(0, 0, 0, -scroll_position) | |
| 4455 | scroll_bar:SetPosition(UDim2.new(1, -20, scroll_position / (content_height - absolute_height) * scroll_space, 0)) | |
| 4456 | scroll_bar:SetSize(UDim2.new(0, 20, absolute_height / content_height, 0)) | |
| 4457 | scroll_bar:SetVisible(true) | |
| 4458 | scroll_pane.Visible = true | |
| 4459 | end | |
| 4460 | end | |
| 4461 | GuiMenu = setmetatable({}, GuiFrame)
| |
| 4462 | GuiMenu.__index = GuiMenu | |
| 4463 | GuiMenu.__default = {__index = {
| |
| 4464 | VerticalSpacing = 18 | |
| 4465 | }} | |
| 4466 | function GuiMenu:AddItem(text, onClick, options) | |
| 4467 | local frameSize = self:GetSize() | |
| 4468 | local frameHeight = frameSize.Y.Offset - self.m_border_size * 2 | |
| 4469 | local verticalSpacing = self.verticalSpacing | |
| 4470 | local properties = {
| |
| 4471 | BackgroundTransparency = 0.75, | |
| 4472 | BorderSize = 0, | |
| 4473 | BorderTransparency = 1, | |
| 4474 | Color = (#self.menuItems % 2 == 1) and Color3.new(0.25, 0.25, 0.25) or Color3.new(0, 0, 0), | |
| 4475 | FontSize = Enum.FontSize.Size12, | |
| 4476 | Position = UDim2.new(0, 0, 0, frameHeight), | |
| 4477 | Size = UDim2.new(1, 0, 0, verticalSpacing), | |
| 4478 | Text = text, | |
| 4479 | Parent = self | |
| 4480 | } | |
| 4481 | if options then | |
| 4482 | for key, value in pairs(options) do | |
| 4483 | properties[key] = value | |
| 4484 | end | |
| 4485 | end | |
| 4486 | local menuItem = GuiTextButton:new(properties) | |
| 4487 | if onClick then | |
| 4488 | menuItem.Activated:connect(function() | |
| 4489 | if not onClick(text, self) then | |
| 4490 | self:Destroy() | |
| 4491 | end | |
| 4492 | end) | |
| 4493 | end | |
| 4494 | self.menuItems[#self.menuItems + 1] = menuItem | |
| 4495 | self:SetSize(frameSize + UDim2.new(0, 0, 0, verticalSpacing)) | |
| 4496 | end | |
| 4497 | function GuiMenu:ClearItems() | |
| 4498 | local menuItems = self.menuItems | |
| 4499 | for _, item in ipairs(menuItems) do | |
| 4500 | menuItems[item] = nil | |
| 4501 | item:Destroy() | |
| 4502 | end | |
| 4503 | local frameSize = self:GetSize() | |
| 4504 | self:SetSize(frameSize + UDim2.new(0, 0, 0, self.m_border_size * 2 - frameSize.Y.Offset)) | |
| 4505 | end | |
| 4506 | function GuiMenu:Destroy() | |
| 4507 | self:ClearItems() | |
| 4508 | GuiFrame.Destroy(self) | |
| 4509 | end | |
| 4510 | function GuiMenu:Init(data) | |
| 4511 | GuiFrame.Init(self, data) | |
| 4512 | setmetatable(data, GuiMenu.__default) | |
| 4513 | self.menuItems = {}
| |
| 4514 | self.verticalSpacing = data.VerticalSpacing | |
| 4515 | end | |
| 4516 | function GuiMenu:IsA(className) | |
| 4517 | return className == "GuiMenu" or GuiFrame.IsA(self, className) | |
| 4518 | end | |
| 4519 | GuiTextList = setmetatable({}, GuiScrollFrame)
| |
| 4520 | GuiTextList.__index = GuiTextList | |
| 4521 | GuiTextList.__default = {__index = {
| |
| 4522 | }} | |
| 4523 | function GuiTextList:AddItem(text, options) | |
| 4524 | local properties = {
| |
| 4525 | BackgroundTransparency = 1, | |
| 4526 | Font = "ArialBold", | |
| 4527 | FontSize = "Size12", | |
| 4528 | Position = UDim2.new(0, 4, 0, self.m_content_height), | |
| 4529 | Size = UDim2.new(1, -8, 0, 12), | |
| 4530 | Text = tostring(text), | |
| 4531 | TextColor3 = Color3.new(1, 1, 1), | |
| 4532 | TextStrokeTransparency = 0.6, | |
| 4533 | TextWrapped = true, | |
| 4534 | TextXAlignment = "Left", | |
| 4535 | Parent = self:GetContentInstance() | |
| 4536 | } | |
| 4537 | if options then | |
| 4538 | for key, value in pairs(options) do | |
| 4539 | properties[key] = value | |
| 4540 | end | |
| 4541 | end | |
| 4542 | local textLabel = RBXInstance.new "TextLabel" (properties) | |
| 4543 | textLabel.Size = UDim2.new(1, 0, 0, textLabel.TextBounds.Y) | |
| 4544 | self.listItems[#self.listItems + 1] = textLabel | |
| 4545 | self:SetContentHeight(self.m_content_height + textLabel.TextBounds.Y) | |
| 4546 | end | |
| 4547 | function GuiTextList:ClearItems() | |
| 4548 | local listItems = self.listItems | |
| 4549 | for _, item in ipairs(listItems) do | |
| 4550 | listItems[item] = nil | |
| 4551 | item:Destroy() | |
| 4552 | end | |
| 4553 | self:SetContentHeight(0) | |
| 4554 | end | |
| 4555 | function GuiTextList:Destroy() | |
| 4556 | self:ClearItems() | |
| 4557 | GuiScrollFrame.Destroy(self) | |
| 4558 | end | |
| 4559 | function GuiTextList:Init(data) | |
| 4560 | GuiScrollFrame.Init(self, data) | |
| 4561 | self.listItems = {}
| |
| 4562 | end | |
| 4563 | function GuiTextList:IsA(className) | |
| 4564 | return className == "GuiTextList" or GuiScrollFrame.IsA(self, className) | |
| 4565 | end | |
| 4566 | GuiNetworkList = setmetatable({}, GuiTextList)
| |
| 4567 | GuiNetworkList.__index = GuiNetworkList | |
| 4568 | function GuiNetworkList:AddItem(systemTime, idleTime, userName, isNil) | |
| 4569 | local frame = GuiFrame:new {
| |
| 4570 | BackgroundTransparency = 1, | |
| 4571 | BorderSize = 0, | |
| 4572 | BorderTransparency = 1, | |
| 4573 | Position = UDim2.new(0, 4, 0, self.m_content_height), | |
| 4574 | Size = UDim2.new(1, -8, 0, 14), | |
| 4575 | } | |
| 4576 | local systemTimeColor | |
| 4577 | if string.sub(systemTime, 1, 1) == "?" then | |
| 4578 | systemTimeColor = Color3.new(1, 0.75, 0.75) | |
| 4579 | else | |
| 4580 | systemTimeColor = Color3.new(0.75, 0.75, 1) | |
| 4581 | end | |
| 4582 | local systemTimeLabel = RBXInstance.new "TextLabel" {
| |
| 4583 | BackgroundTransparency = 1, | |
| 4584 | Font = "ArialBold", | |
| 4585 | FontSize = "Size12", | |
| 4586 | Position = UDim2.new(0, 0, 0, 0), | |
| 4587 | Size = UDim2.new(0, 50, 1, 0), | |
| 4588 | Text = systemTime, | |
| 4589 | TextColor3 = systemTimeColor, | |
| 4590 | TextStrokeTransparency = 0.6, | |
| 4591 | TextXAlignment = "Left", | |
| 4592 | Parent = frame:GetContentInstance() | |
| 4593 | } | |
| 4594 | local idle_time_color | |
| 4595 | if string.sub(idleTime, 1, 1) == "0" then | |
| 4596 | idle_time_color = Color3.new(1, 1, 1) | |
| 4597 | else | |
| 4598 | idle_time_color = Color3.new(1, 0.75, 0.75) | |
| 4599 | end | |
| 4600 | local idleTimeLabel = RBXInstance.new "TextLabel" {
| |
| 4601 | BackgroundTransparency = 1, | |
| 4602 | Font = "ArialBold", | |
| 4603 | FontSize = "Size12", | |
| 4604 | Position = UDim2.new(0, 40, 0, 0), | |
| 4605 | Size = UDim2.new(0, 45, 1, 0), | |
| 4606 | Text = idleTime, | |
| 4607 | TextColor3 = idle_time_color, | |
| 4608 | TextStrokeTransparency = 0.6, | |
| 4609 | TextXAlignment = "Right", | |
| 4610 | Parent = frame:GetContentInstance() | |
| 4611 | } | |
| 4612 | local userNameLabel = GuiTextButton:new {
| |
| 4613 | AutoButtonColor = false, | |
| 4614 | BackgroundTransparency = 1, | |
| 4615 | BorderSize = 0, | |
| 4616 | BorderTransparency = 1, | |
| 4617 | Font = Enum.Font.SourceSansBold, | |
| 4618 | FontSize = Enum.FontSize.Size14, | |
| 4619 | Position = UDim2.new(0, 98, 0, 0), | |
| 4620 | Size = UDim2.new(1, -98, 1, 0), | |
| 4621 | TextXAlignment = Enum.TextXAlignment.Left, | |
| 4622 | Text = userName, | |
| 4623 | Parent = frame | |
| 4624 | } | |
| 4625 | frame:SetParent(self) | |
| 4626 | local userNameWidth = userNameLabel:GetTextBounds().X | |
| 4627 | userNameLabel:SetSize(UDim2.new(0, userNameWidth + 4, 1, 0)) | |
| 4628 | if isNil then | |
| 4629 | local isNilLabel = RBXInstance.new "TextLabel" {
| |
| 4630 | BackgroundTransparency = 1, | |
| 4631 | Font = "SourceSans", | |
| 4632 | FontSize = "Size14", | |
| 4633 | Position = UDim2.new(0, 100 + userNameWidth + 8, 0, 0), | |
| 4634 | Size = UDim2.new(0, 50, 1, 0), | |
| 4635 | Text = "(nil)", | |
| 4636 | TextColor3 = Color3.new(1, 0.4, 0.4), | |
| 4637 | TextStrokeTransparency = 0.6, | |
| 4638 | TextXAlignment = "Left", | |
| 4639 | Parent = frame:GetContentInstance() | |
| 4640 | } | |
| 4641 | end | |
| 4642 | self.listItems[#self.listItems + 1] = frame | |
| 4643 | self:SetContentHeight(self.m_content_height + 14) | |
| 4644 | end | |
| 4645 | function GuiNetworkList:IsA(className) | |
| 4646 | return className == "GuiNetworkList" or GuiTextList.IsA(self, className) | |
| 4647 | end | |
| 4648 | GuiTextOutput = setmetatable({}, GuiScrollFrame)
| |
| 4649 | GuiTextOutput.__index = GuiTextOutput | |
| 4650 | GuiTextOutput.__default = {__index = {
| |
| 4651 | DisplayMaxLines = 120, | |
| 4652 | DisplayWidth = 0 | |
| 4653 | }} | |
| 4654 | function GuiTextOutput:Init(data) | |
| 4655 | GuiScrollFrame.Init(self, data) | |
| 4656 | setmetatable(data, GuiTextOutput.__default) | |
| 4657 | self.displayMaxLines = data.DisplayMaxLines | |
| 4658 | self.displayWidth = data.DisplayWidth | |
| 4659 | self.displayItems = {}
| |
| 4660 | self:SetBackgroundTransparency(0) | |
| 4661 | self:SetColor(Color3.new(1, 1, 1)) | |
| 4662 | self.m_scroll_pane.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5) | |
| 4663 | end | |
| 4664 | function GuiTextOutput:IsA(className) | |
| 4665 | return className == "GuiTextOutput" or GuiScrollFrame.IsA(self, className) | |
| 4666 | end | |
| 4667 | function GuiTextOutput:Print(...) | |
| 4668 | self:PrintFormat(nil, ...) | |
| 4669 | end | |
| 4670 | function GuiTextOutput:PrintFormat(options, ...) | |
| 4671 | local buffer = {}
| |
| 4672 | local args = {...}
| |
| 4673 | local first = true | |
| 4674 | for i = 1, select("#", ...) do
| |
| 4675 | buffer[i] = tostring(args[i]) | |
| 4676 | end | |
| 4677 | message = Utility.BlockRobloxFilter(table.concat(buffer, "\t")) | |
| 4678 | local properties = {
| |
| 4679 | BackgroundTransparency = 1, | |
| 4680 | Font = "ArialBold", | |
| 4681 | FontSize = "Size12", | |
| 4682 | Position = UDim2.new(0, 4, 0, self.m_content_height), | |
| 4683 | Text = message, | |
| 4684 | TextColor3 = Color3.new(1, 1, 1), | |
| 4685 | TextWrapped = true, | |
| 4686 | TextXAlignment = "Left", | |
| 4687 | TextYAlignment = "Bottom", | |
| 4688 | Parent = self:GetContentInstance() | |
| 4689 | } | |
| 4690 | if options then | |
| 4691 | for key, value in pairs(options) do | |
| 4692 | properties[key] = value | |
| 4693 | end | |
| 4694 | end | |
| 4695 | local textBounds = GuiService:GetTextBounds(message, properties.Font, properties.FontSize, properties.TextXAlignment, properties.TextYAlignment, | |
| 4696 | ||
| 4697 | self.displayWidth - 20) | |
| 4698 | local textHeight = textBounds.Y | |
| 4699 | properties.Size = UDim2.new(0, self.displayWidth - 8, 0, textBounds.Y) | |
| 4700 | local textLabel = RBXInstance.new "TextLabel" (properties) | |
| 4701 | self.displayItems[#self.displayItems + 1] = textLabel | |
| 4702 | local maxLines = self.displayMaxLines | |
| 4703 | local maxHeight = maxLines * 12 | |
| 4704 | local newHeight = self.m_content_height + textHeight | |
| 4705 | if newHeight > maxHeight then | |
| 4706 | local offset = 0 | |
| 4707 | local newList = {}
| |
| 4708 | local oldList = self.displayItems | |
| 4709 | for index, child in ipairs(oldList) do | |
| 4710 | local childOffset = child.Size.Y.Offset | |
| 4711 | if newHeight > maxHeight then | |
| 4712 | offset = offset + childOffset | |
| 4713 | newHeight = newHeight - childOffset | |
| 4714 | child:Destroy() | |
| 4715 | else | |
| 4716 | child.Position = child.Position - UDim2.new(0, 0, 0, offset) | |
| 4717 | newList[#newList + 1] = child | |
| 4718 | end | |
| 4719 | end | |
| 4720 | self.displayItems = newList | |
| 4721 | end | |
| 4722 | self:SetContentHeight(newHeight) | |
| 4723 | end | |
| 4724 | GuiChatLog = setmetatable({}, GuiScrollFrame)
| |
| 4725 | GuiChatLog.__index = GuiChatLog | |
| 4726 | GuiChatLog.__default = {__index = {
| |
| 4727 | DisplayMaxLines = 200, | |
| 4728 | DisplayWidth = 0, | |
| 4729 | }} | |
| 4730 | function GuiChatLog:Chat(speaker, message) | |
| 4731 | local speaker_color = AdvancedGUI.GenerateChatColor(speaker) | |
| 4732 | speaker = Utility.BlockRobloxFilter(speaker) | |
| 4733 | message = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" .. Utility.BlockRobloxFilter(message) | |
| 4734 | local timestamp = Utility.GetTimestamp() | |
| 4735 | local textBounds = GuiService:GetTextBounds(message, "ArialBold", "Size12", "Left", "Bottom", self.displayWidth - 8) | |
| 4736 | local textHeight = math.max(math.min(textBounds.Y, 36), 12) | |
| 4737 | local message_frame = RBXInstance.new "Frame" {
| |
| 4738 | BackgroundTransparency = 1, | |
| 4739 | Position = UDim2.new(0, 0, 0, self.m_content_height), | |
| 4740 | Size = UDim2.new(0, self.displayWidth, 0, textHeight), | |
| 4741 | Parent = self:GetContentInstance() | |
| 4742 | } | |
| 4743 | local timestamp_label = RBXInstance.new "TextLabel" {
| |
| 4744 | BackgroundTransparency = 1, | |
| 4745 | Font = "ArialBold", | |
| 4746 | FontSize = "Size12", | |
| 4747 | Position = UDim2.new(0, 4, 0, 0), | |
| 4748 | Size = UDim2.new(1, -8, 0, 12), | |
| 4749 | Text = timestamp, | |
| 4750 | TextColor3 = Color3.new(0.75, 0.75, 0.75), | |
| 4751 | TextStrokeTransparency = 0.6, | |
| 4752 | TextWrapped = true, | |
| 4753 | TextXAlignment = "Left", | |
| 4754 | Parent = message_frame | |
| 4755 | } | |
| 4756 | local speaker_label = RBXInstance.new "TextLabel" {
| |
| 4757 | BackgroundTransparency = 1, | |
| 4758 | Font = "ArialBold", | |
| 4759 | FontSize = "Size12", | |
| 4760 | Position = UDim2.new(0, 64, 0, 0), | |
| 4761 | Size = UDim2.new(0, 100, 0, 12), | |
| 4762 | Text = speaker, | |
| 4763 | TextColor3 = speaker_color, | |
| 4764 | TextStrokeTransparency = 0.6, | |
| 4765 | Parent = message_frame | |
| 4766 | } | |
| 4767 | local message_label = RBXInstance.new "TextLabel" {
| |
| 4768 | BackgroundTransparency = 1, | |
| 4769 | Font = "ArialBold", | |
| 4770 | FontSize = "Size12", | |
| 4771 | Position = UDim2.new(0, 4, 0, 0), | |
| 4772 | Size = UDim2.new(1, -8, 1, 0), | |
| 4773 | Text = message, | |
| 4774 | TextColor3 = Color3.new(1, 1, 1), | |
| 4775 | TextStrokeTransparency = 0.6, | |
| 4776 | TextXAlignment = "Left", | |
| 4777 | TextYAlignment = "Bottom", | |
| 4778 | TextWrapped = true, | |
| 4779 | Parent = message_frame | |
| 4780 | } | |
| 4781 | self.displayItems[#self.displayItems + 1] = message_frame | |
| 4782 | local maxLines = self.displayMaxLines | |
| 4783 | local maxHeight = maxLines * 12 | |
| 4784 | local newHeight = self.m_content_height + textHeight | |
| 4785 | if newHeight > maxHeight then | |
| 4786 | local offset = 0 | |
| 4787 | local newList = {}
| |
| 4788 | local oldList = self.displayItems | |
| 4789 | for index, child in ipairs(oldList) do | |
| 4790 | local childOffset = child.Size.Y.Offset | |
| 4791 | if newHeight > maxHeight then | |
| 4792 | offset = offset + childOffset | |
| 4793 | newHeight = newHeight - childOffset | |
| 4794 | child:Destroy() | |
| 4795 | else | |
| 4796 | child.Position = child.Position - UDim2.new(0, 0, 0, offset) | |
| 4797 | newList[#newList + 1] = child | |
| 4798 | end | |
| 4799 | end | |
| 4800 | self.displayItems = newList | |
| 4801 | end | |
| 4802 | self:SetContentHeight(newHeight) | |
| 4803 | end | |
| 4804 | function GuiChatLog:Init(data) | |
| 4805 | GuiScrollFrame.Init(self, data) | |
| 4806 | setmetatable(data, GuiChatLog.__default) | |
| 4807 | self.displayMaxLines = data.DisplayMaxLines | |
| 4808 | self.displayWidth = data.DisplayWidth | |
| 4809 | self.displayItems = {}
| |
| 4810 | end | |
| 4811 | function GuiChatLog:IsA(className) | |
| 4812 | return className == "GuiChatLog" or GuiScrollFrame.IsA(self, className) | |
| 4813 | end | |
| 4814 | GuiSeperator = setmetatable({}, GuiObject)
| |
| 4815 | GuiSeperator.__index = GuiSeperator | |
| 4816 | GuiSeperator.__default = {__index = {
| |
| 4817 | Active = false, | |
| 4818 | Position = UDim2.new(0, 0, 0, 0), | |
| 4819 | Size = UDim2.new(1, 0, 0, 16), | |
| 4820 | Visible = true | |
| 4821 | }} | |
| 4822 | function GuiSeperator:Init(data) | |
| 4823 | GuiObject.Init(self) | |
| 4824 | setmetatable(data, GuiSeperator.__default) | |
| 4825 | local base_frame = RBXInstance.new "Frame" {
| |
| 4826 | BackgroundTransparency = 1, | |
| 4827 | RBXInstance.new "Frame" {
| |
| 4828 | BackgroundColor3 = Color3.new(1, 1, 1), | |
| 4829 | BackgroundTransparency = 0.25, | |
| 4830 | BorderSizePixel = 0, | |
| 4831 | Position = UDim2.new(0.5, -13, 0.5, -1), | |
| 4832 | Size = UDim2.new(0, 3, 0, 3), | |
| 4833 | RBXInstance.new "Frame" {
| |
| 4834 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 4835 | BackgroundTransparency = 0.75, | |
| 4836 | BorderSizePixel = 0, | |
| 4837 | Position = UDim2.new(0, -1, 0, -1), | |
| 4838 | Size = UDim2.new(0, 5, 0, 5) | |
| 4839 | } | |
| 4840 | }, | |
| 4841 | RBXInstance.new "Frame" {
| |
| 4842 | BackgroundColor3 = Color3.new(1, 1, 1), | |
| 4843 | BackgroundTransparency = 0.25, | |
| 4844 | BorderSizePixel = 0, | |
| 4845 | Position = UDim2.new(0.5, -1, 0.5, -1), | |
| 4846 | Size = UDim2.new(0, 3, 0, 3), | |
| 4847 | RBXInstance.new "Frame" {
| |
| 4848 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 4849 | BackgroundTransparency = 0.75, | |
| 4850 | BorderSizePixel = 0, | |
| 4851 | Position = UDim2.new(0, -1, 0, -1), | |
| 4852 | Size = UDim2.new(0, 5, 0, 5) | |
| 4853 | } | |
| 4854 | }, | |
| 4855 | RBXInstance.new "Frame" {
| |
| 4856 | BackgroundColor3 = Color3.new(1, 1, 1), | |
| 4857 | BackgroundTransparency = 0.25, | |
| 4858 | BorderSizePixel = 0, | |
| 4859 | Position = UDim2.new(0.5, 11, 0.5, -1), | |
| 4860 | Size = UDim2.new(0, 3, 0, 3), | |
| 4861 | RBXInstance.new "Frame" {
| |
| 4862 | BackgroundColor3 = Color3.new(0, 0, 0), | |
| 4863 | BackgroundTransparency = 0.75, | |
| 4864 | BorderSizePixel = 0, | |
| 4865 | Position = UDim2.new(0, -1, 0, -1), | |
| 4866 | Size = UDim2.new(0, 5, 0, 5) | |
| 4867 | } | |
| 4868 | } | |
| 4869 | } | |
| 4870 | self.m_base_instance = base_frame | |
| 4871 | self:SetActive(data.Active) | |
| 4872 | self:SetPosition(data.Position) | |
| 4873 | self:SetSize(data.Size) | |
| 4874 | self:SetVisible(data.Visible) | |
| 4875 | self:SetParent(data.Parent) | |
| 4876 | end | |
| 4877 | function GuiSeperator:IsA(className) | |
| 4878 | return className == "GuiSeperator" or GuiObject.IsA(self, className) | |
| 4879 | end | |
| 4880 | local startMenu = GuiFrame:new {
| |
| 4881 | BorderTransparency = 0.5, | |
| 4882 | Position = UDim2.new(0, -4, 0, -4), | |
| 4883 | Size = UDim2.new(0, 68, 1, 8), | |
| 4884 | Parent = GuiService | |
| 4885 | } | |
| 4886 | GuiSeperator:new {
| |
| 4887 | Position = UDim2.new(0, 0, 0, 5), | |
| 4888 | Parent = startMenu | |
| 4889 | } | |
| 4890 | GuiSeperator:new {
| |
| 4891 | Position = UDim2.new(0, 0, 1, -85), | |
| 4892 | Parent = startMenu | |
| 4893 | } | |
| 4894 | local networkButton = GuiTextButton:new {
| |
| 4895 | BackgroundTransparency = 0.9, | |
| 4896 | Mnemonic = "L", | |
| 4897 | Position = UDim2.new(0, 4, 1, -647), | |
| 4898 | Text = "Network", | |
| 4899 | Parent = startMenu | |
| 4900 | } | |
| 4901 | local chatLogButton = GuiTextButton:new {
| |
| 4902 | BackgroundTransparency = 0.9, | |
| 4903 | Mnemonic = "K", | |
| 4904 | Position = UDim2.new(0, 4, 1, -475), | |
| 4905 | Text = "Chat log", | |
| 4906 | Parent = startMenu | |
| 4907 | } | |
| 4908 | local outputButton = GuiTextButton:new {
| |
| 4909 | BackgroundTransparency = 0.9, | |
| 4910 | Mnemonic = "P", | |
| 4911 | Position = UDim2.new(0, 4, 1, -283), | |
| 4912 | Text = "Output", | |
| 4913 | Parent = startMenu | |
| 4914 | } | |
| 4915 | local toolsButton = GuiTextButton:new {
| |
| 4916 | BackgroundTransparency = 0.9, | |
| 4917 | Mnemonic = "O", | |
| 4918 | Position = UDim2.new(0, 4, 1, -137), | |
| 4919 | Text = "Tools", | |
| 4920 | Parent = startMenu | |
| 4921 | } | |
| 4922 | local networkFrame = GuiNetworkList:new {
| |
| 4923 | Position = UDim2.new(0, 66, 1, -647), | |
| 4924 | Size = UDim2.new(0, 0, 0, 168), | |
| 4925 | Visible = false, | |
| 4926 | Parent = GuiService | |
| 4927 | } | |
| 4928 | local chatLogFrame = GuiChatLog:new {
| |
| 4929 | DisplayWidth = 332, | |
| 4930 | Position = UDim2.new(0, 66, 1, -475), | |
| 4931 | Size = UDim2.new(0, 0, 0, 188), | |
| 4932 | Visible = false, | |
| 4933 | Parent = GuiService | |
| 4934 | } | |
| 4935 | local outputFrame = GuiTextOutput:new {
| |
| 4936 | DisplayWidth = 332, | |
| 4937 | Position = UDim2.new(0, 66, 1, -283), | |
| 4938 | Size = UDim2.new(0, 0, 0, 140), | |
| 4939 | Visible = false, | |
| 4940 | Parent = GuiService | |
| 4941 | } | |
| 4942 | local toolsFrame = GuiFrame:new {
| |
| 4943 | Position = UDim2.new(0, 66, 1, -137), | |
| 4944 | Size = UDim2.new(0, 0, 0, 52), | |
| 4945 | Visible = false, | |
| 4946 | Parent = GuiService | |
| 4947 | } | |
| 4948 | local toggleCharacterButton = GuiTextButton:new {
| |
| 4949 | BackgroundTransparency = 0.9, | |
| 4950 | Position = UDim2.new(0, 1, 0, 1), | |
| 4951 | Size = UDim2.new(0, 108, 0, 20), | |
| 4952 | Text = "Enable character", | |
| 4953 | Parent = toolsFrame | |
| 4954 | } | |
| 4955 | local resetCharacterButton = GuiTextButton:new {
| |
| 4956 | BackgroundTransparency = 0.9, | |
| 4957 | Position = UDim2.new(0, 1, 0, 23), | |
| 4958 | Size = UDim2.new(0, 108, 0, 20), | |
| 4959 | Text = "Reset character", | |
| 4960 | Parent = toosFrame | |
| 4961 | } | |
| 4962 | local clearWorkspaceButton = GuiTextButton:new {
| |
| 4963 | BackgroundTransparency = 0.9, | |
| 4964 | Position = UDim2.new(0, 110, 0, 1), | |
| 4965 | Size = UDim2.new(0, 108, 0, 20), | |
| 4966 | Text = "Clear workspace", | |
| 4967 | Parent = toolsFrame | |
| 4968 | } | |
| 4969 | local clearScriptButton = GuiTextButton:new {
| |
| 4970 | BackgroundTransparency = 0.9, | |
| 4971 | Position = UDim2.new(0, 110, 0, 23), | |
| 4972 | Size = UDim2.new(0, 108, 0, 20), | |
| 4973 | Text = "Clear all", | |
| 4974 | Parent = toolsFrame | |
| 4975 | } | |
| 4976 | local fixLightingButton = GuiTextButton:new {
| |
| 4977 | BackgroundTransparency = 0.9, | |
| 4978 | Position = UDim2.new(0, 219, 0, 1), | |
| 4979 | Size = UDim2.new(0, 108, 0, 20), | |
| 4980 | Text = "Fix lighting", | |
| 4981 | Parent = toolsFrame | |
| 4982 | } | |
| 4983 | local reloadCommandsButton = GuiTextButton:new {
| |
| 4984 | BackgroundTransparency = 0.9, | |
| 4985 | Position = UDim2.new(0, 219, 0, 23), | |
| 4986 | Size = UDim2.new(0, 108, 0, 20), | |
| 4987 | Text = "Reload commands", | |
| 4988 | Parent = toolsFrame | |
| 4989 | } | |
| 4990 | toggleCharacterButton.Activated:connect(function() | |
| 4991 | local enabled = not PlayerControl.IsEnabled() | |
| 4992 | if enabled then | |
| 4993 | toggleCharacterButton:SetText("Disable character")
| |
| 4994 | else | |
| 4995 | toggleCharacterButton:SetText("Enable character")
| |
| 4996 | end | |
| 4997 | PlayerControl.SetEnabled(enabled) | |
| 4998 | end) | |
| 4999 | resetCharacterButton.Activated:connect(function() | |
| 5000 | PlayerControl.ResetCharacter() | |
| 5001 | end) | |
| 5002 | clearWorkspaceButton.Activated:connect(function() | |
| 5003 | Utility.CleanWorkspace() | |
| 5004 | end) | |
| 5005 | clearScriptButton.Activated:connect(function() | |
| 5006 | Utility.CleanWorkspaceAndScripts() | |
| 5007 | end) | |
| 5008 | fixLightingButton.Activated:connect(function() | |
| 5009 | Utility.CleanLighting() | |
| 5010 | end) | |
| 5011 | reloadCommandsButton.Activated:connect(function() | |
| 5012 | UserInterface.FixChattedConnection() | |
| 5013 | end) | |
| 5014 | local networkFrameActive = false | |
| 5015 | local networkFrameTweening = false | |
| 5016 | networkButton.Activated:connect(function() | |
| 5017 | if not networkFrameTweening then | |
| 5018 | networkFrameActive = not networkFrameActive | |
| 5019 | networkFrameTweening = true | |
| 5020 | if networkFrameActive then | |
| 5021 | networkFrame:SetVisible(true) | |
| 5022 | networkFrame.m_base_instance:TweenSize(UDim2.new(0, 276, 0, 168), nil, nil, 0.5) | |
| 5023 | wait(0.5) | |
| 5024 | else | |
| 5025 | networkFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 168), nil, nil, 0.5) | |
| 5026 | wait(0.5) | |
| 5027 | networkFrame:SetVisible(false) | |
| 5028 | end | |
| 5029 | networkFrameTweening = false | |
| 5030 | end | |
| 5031 | end) | |
| 5032 | local chatLogFrameActive = false | |
| 5033 | local chatLogFrameTweening = false | |
| 5034 | chatLogButton.Activated:connect(function() | |
| 5035 | if not chatLogFrameTweening then | |
| 5036 | chatLogFrameActive = not chatLogFrameActive | |
| 5037 | chatLogFrameTweening = true | |
| 5038 | if chatLogFrameActive then | |
| 5039 | chatLogFrame:SetVisible(true) | |
| 5040 | chatLogFrame.m_base_instance:TweenSize(UDim2.new(0, 360, 0, 188), nil, nil, 0.5) | |
| 5041 | wait(0.5) | |
| 5042 | else | |
| 5043 | chatLogFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 188), nil, nil, 0.5) | |
| 5044 | wait(0.5) | |
| 5045 | chatLogFrame:SetVisible(false) | |
| 5046 | end | |
| 5047 | chatLogFrameTweening = false | |
| 5048 | end | |
| 5049 | end) | |
| 5050 | local outputFrameActive = false | |
| 5051 | local outputFrameTweening = false | |
| 5052 | outputButton.Activated:connect(function() | |
| 5053 | if not outputFrameTweening then | |
| 5054 | outputFrameActive = not outputFrameActive | |
| 5055 | outputFrameTweening = true | |
| 5056 | if outputFrameActive then | |
| 5057 | outputFrame:SetVisible(true) | |
| 5058 | outputFrame.m_base_instance:TweenSize(UDim2.new(0, 360, 0, 140), nil, nil, 0.5) | |
| 5059 | wait(0.5) | |
| 5060 | else | |
| 5061 | outputFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 140), nil, nil, 0.5) | |
| 5062 | wait(0.5) | |
| 5063 | outputFrame:SetVisible(false) | |
| 5064 | end | |
| 5065 | outputFrameTweening = false | |
| 5066 | end | |
| 5067 | end) | |
| 5068 | local toolsFrameActive = false | |
| 5069 | local toolsFrameTweening = false | |
| 5070 | toolsButton.Activated:connect(function() | |
| 5071 | if not toolsFrameTweening then | |
| 5072 | toolsFrameActive = not toolsFrameActive | |
| 5073 | toolsFrameTweening = true | |
| 5074 | if toolsFrameActive then | |
| 5075 | toolsFrame:SetVisible(true) | |
| 5076 | toolsFrame.m_base_instance:TweenSize(UDim2.new(0, 336, 0, 52), nil, nil, 0.5) | |
| 5077 | wait(0.5) | |
| 5078 | else | |
| 5079 | toolsFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 52), nil, nil, 0.5) | |
| 5080 | wait(0.5) | |
| 5081 | toolsFrame:SetVisible(false) | |
| 5082 | end | |
| 5083 | toolsFrameTweening = false | |
| 5084 | end | |
| 5085 | end) | |
| 5086 | AdvancedGUI.startMenu = startMenu | |
| 5087 | AdvancedGUI.networkFrame = networkFrame | |
| 5088 | AdvancedGUI.outputFrame = outputFrame | |
| 5089 | AdvancedGUI.toolsFrame = toolsFrame | |
| 5090 | AdvancedGUI.chatLogFrame = chatLogFrame | |
| 5091 | AdvancedGUI.toggleCharacterButton = toggleCharacterButton | |
| 5092 | AdvancedGUI.reloadCommandsButton = reloadCommandsButton | |
| 5093 | function AdvancedGUI.Print(...) | |
| 5094 | AdvancedGUI.outputFrame:Print(...) | |
| 5095 | end | |
| 5096 | function AdvancedGUI.PrintFormat(...) | |
| 5097 | AdvancedGUI.outputFrame:PrintFormat(...) | |
| 5098 | end | |
| 5099 | function AdvancedGUI.PrintChatLog(speaker, message) | |
| 5100 | AdvancedGUI.chatLogFrame:Chat(speaker, message) | |
| 5101 | end | |
| 5102 | for _, entry in Logger.NodeIterator, Logger.entries do | |
| 5103 | if entry then | |
| 5104 | local messageType = entry[1] | |
| 5105 | local messageTypeValue | |
| 5106 | if messageType == Logger.MessageType.Error then | |
| 5107 | messageTypeValue = Logger.MessageType.Severe.Value | |
| 5108 | else | |
| 5109 | messageTypeValue = messageType.Value | |
| 5110 | end | |
| 5111 | AdvancedGUI.outputFrame:PrintFormat(Logger.MESSAGE_TYPE_SETTINGS[messageTypeValue], entry[2]) | |
| 5112 | else | |
| 5113 | break | |
| 5114 | end | |
| 5115 | end | |
| 5116 | ||
| 5117 | function GetPlayers(str) | |
| 5118 | local found = {};
| |
| 5119 | if str == "all" then | |
| 5120 | for i,v in pairs(game.Players:children()) do | |
| 5121 | if v:IsA("Player") then table.insert(found,v) end
| |
| 5122 | end | |
| 5123 | else | |
| 5124 | for i,v in pairs(game.Players:children()) do | |
| 5125 | if string.match(v.Name:lower(), str:lower()) and v:IsA("Player") then
| |
| 5126 | table.insert(found,v) | |
| 5127 | end | |
| 5128 | end | |
| 5129 | end | |
| 5130 | return found | |
| 5131 | end | |
| 5132 | ||
| 5133 | function NewCMD(nme, usg, desc,func) | |
| 5134 | table.insert(CMDS, {['Name']=nme, ['Usage']=usg, ['Description']=desc, ['Function']=func})
| |
| 5135 | end | |
| 5136 | ||
| 5137 | NewCMD("Chat Theme", "ctheme", "Changes the chat theme", function(msg) ChatBubble.SetTheme(msg) end)
| |
| 5138 | NewCMD("Clean", "clr", "Clears the game", function() Utility.CleanWorkspaceAndScripts() end)
| |
| 5139 | NewCMD("Fix Lighting", "fixl", "Fixes the lighting",function() Utility.CleanLighting() end)
| |
| 5140 | NewCMD("Dismiss", "d", "Dismisses tabs",function()
| |
| 5141 | Dismiss() | |
| 5142 | ChatBubble.Create("Dismissed Tabs...")
| |
| 5143 | end) | |
| 5144 | ||
| 5145 | NewCMD("Kill", "kill", "Kills the player", function(msg)
| |
| 5146 | local plrs = GetPlayers(msg) | |
| 5147 | for _,plr in next,plrs do | |
| 5148 | ||
| 5149 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
| |
| 5150 | plr.Character:BreakJoints() | |
| 5151 | ||
| 5152 | end | |
| 5153 | end) | |
| 5154 | ||
| 5155 | NewCMD("Private Server", "ps", "Makes the server private!",function()
| |
| 5156 | game.Players.PlayerAdded:connect(function(player) | |
| 5157 | player.CharacterAdded:connect(function(h) | |
| 5158 | if player.Name ~= "PointCoded" or "nguyenjimbo" or game.Players.LocalPlayer.Name then | |
| 5159 | wait(0.5) | |
| 5160 | player:Kick() | |
| 5161 | end | |
| 5162 | end) | |
| 5163 | end) | |
| 5164 | ChatBubble.Create("Private Server is Activated")
| |
| 5165 | end) | |
| 5166 | ||
| 5167 | NewCMD("nonPrivate Server", "nps", "Makes the server not private!",function()
| |
| 5168 | Pserver = false | |
| 5169 | ChatBubble.Create("Private Server Is no longer Activated")
| |
| 5170 | end) | |
| 5171 | ||
| 5172 | ||
| 5173 | NewCMD("Remove hidden sb", "rhs", "Removes a player's hidden sb", function(msg)
| |
| 5174 | local plrs = GetPlayers(msg) | |
| 5175 | for _,plr in next,plrs do | |
| 5176 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
| |
| 5177 | plr.PlayerGui:ClearAllChildren() | |
| 5178 | end | |
| 5179 | end) | |
| 5180 | ||
| 5181 | NewCMD("Day", "day", "Makes the time day", function()
| |
| 5182 | game.Lighting.TimeOfDay = "12:00:00" | |
| 5183 | ChatBubble.Create("It is now day")
| |
| 5184 | end) | |
| 5185 | ||
| 5186 | NewCMD("Night", "night", "Makes the time night", function()
| |
| 5187 | game.Lighting.TimeOfDay = "00:00:00" | |
| 5188 | ChatBubble.Create("It is now night")
| |
| 5189 | end) | |
| 5190 | ||
| 5191 | NewCMD("Midnight", "midnight", "Makes the time midnight", function()
| |
| 5192 | game.Lighting.TimeOfDay = "06:00:00" | |
| 5193 | ChatBubble.Create("It is now midnight")
| |
| 5194 | end) | |
| 5195 | ||
| 5196 | ||
| 5197 | NewCMD("Teleport", "tp", "Teleports you to a player",function(msg)
| |
| 5198 | local plrs = GetPlayers(msg) | |
| 5199 | for _,plr in next,plrs do | |
| 5200 | local Nam = plr.Name | |
| 5201 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.5})
| |
| 5202 | Player.Character.Torso.CFrame = plr.Character.Torso.CFrame | |
| 5203 | ChatBubble.Create("Teleported you to: "..Nam.."!")
| |
| 5204 | end | |
| 5205 | end) | |
| 5206 | ||
| 5207 | NewCMD("Admin", "adm", "Admins a player",function(msg)
| |
| 5208 | local plrs = GetPlayers(msg) | |
| 5209 | for _,plr in next,plrs do | |
| 5210 | if plr.Character then | |
| 5211 | local shared = script:clone() | |
| 5212 | shared.Disabled = true | |
| 5213 | shared.Parent = plr.Backpack | |
| 5214 | wait(1) | |
| 5215 | shared.Disabled = false | |
| 5216 | end | |
| 5217 | end | |
| 5218 | end) | |
| 5219 | ||
| 5220 | NewCMD("Blast", "blas", "Blasts a player",function(msg)
| |
| 5221 | local plrs = GetPlayers(msg) | |
| 5222 | for _,plr in next,plrs do | |
| 5223 | function HSV(H,S,V) | |
| 5224 | plr.Character.Torso.Anchored = true | |
| 5225 | H = H % 360 | |
| 5226 | local C = V * S | |
| 5227 | local H2 = H/60 | |
| 5228 | local X = C * (1 - math.abs((H2 %2) -1)) | |
| 5229 | local color = Color3.new(0,0,0) | |
| 5230 | if H2 <= 0 then | |
| 5231 | color = Color3.new(C,0,0) | |
| 5232 | elseif 0 <= H2 and H2 <= 1 then | |
| 5233 | color = Color3.new(C,X,0) | |
| 5234 | elseif 1 <= H2 and H2 <= 2 then | |
| 5235 | color = Color3.new(X,C,0) | |
| 5236 | elseif 2 <= H2 and H2 <= 3 then | |
| 5237 | color = Color3.new(0,C,X) | |
| 5238 | elseif 3 <= H2 and H2 <= 4 then | |
| 5239 | color = Color3.new(0,X,C) | |
| 5240 | elseif 4 <= H2 and H2 <= 5 then | |
| 5241 | color = Color3.new(X,0,C) | |
| 5242 | elseif 5 <= H2 and H2 <= 6 then | |
| 5243 | color = Color3.new(C,0,X) | |
| 5244 | end | |
| 5245 | local m = V - C | |
| 5246 | return Color3.new(color.r + m, color.g + m, color.b + m) | |
| 5247 | end | |
| 5248 | ||
| 5249 | ||
| 5250 | if plr.Character.Torso then | |
| 5251 | plr.Character.Torso.CFrame = plr.Character.Torso.CFrame * CFrame.new(0, 350, 0) | |
| 5252 | wait(2) | |
| 5253 | local p = Instance.new("Part", workspace)
| |
| 5254 | p.FormFactor = "Custom" | |
| 5255 | p.Anchored = true | |
| 5256 | p.Locked = true | |
| 5257 | p.CFrame = CFrame.new(plr.Character.Torso.CFrame.x,plr.Character.Torso.CFrame.y, plr.Character.Torso.CFrame.z) * CFrame.Angles(math.pi/2, 0, 0) | |
| 5258 | p.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 5259 | p.CanCollide = false | |
| 5260 | local msh = Instance.new("SpecialMesh", p)
| |
| 5261 | msh.MeshId = "http://www.roblox.com/asset/?id=3270017" | |
| 5262 | msh.TextureId = "http://www.roblox.com/asset/?id=48358980" | |
| 5263 | ||
| 5264 | local hue = 0 | |
| 5265 | for _ = 0, 5000 do | |
| 5266 | hue = ((hue+0.5)%360) | |
| 5267 | msh.Scale = msh.Scale + Vector3.new(2, 2, 0) | |
| 5268 | p.Transparency = p.Transparency + 0.005 | |
| 5269 | local colur = HSV(hue,1,1) | |
| 5270 | msh.VertexColor = Vector3.new(colur.r,colur.g,colur.b) | |
| 5271 | wait() | |
| 5272 | plr.Character.Torso.Anchored = false | |
| 5273 | end | |
| 5274 | end | |
| 5275 | end | |
| 5276 | end) | |
| 5277 | ||
| 5278 | NewCMD("Fire", "fi", "Sets a player on fire",function(msg)
| |
| 5279 | local plrs = GetPlayers(msg) | |
| 5280 | for _,plr in next,plrs do | |
| 5281 | local Nam = plr.Name | |
| 5282 | local F = Instance.new("Fire")
| |
| 5283 | F.Parent = plr.Character.Torso | |
| 5284 | ChatBubble.Create("Given Fire to: "..plr.Name"!")
| |
| 5285 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Deep orange"), float_duration = 0.2})
| |
| 5286 | end | |
| 5287 | end) | |
| 5288 | ||
| 5289 | NewCMD("Sparkles", "spa", "Gives a player sparkles",function(msg)
| |
| 5290 | local plrs = GetPlayers(msg) | |
| 5291 | for _,plr in next,plrs do | |
| 5292 | local F = Instance.new("Sparkles")
| |
| 5293 | F.Parent = plr.Character.Torso | |
| 5294 | ChatBubble.Create("Given Sparkles")
| |
| 5295 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
| |
| 5296 | end | |
| 5297 | end) | |
| 5298 | NewCMD("Rpe", "rpe", "Lets you rpe a player",function(msg)
| |
| 5299 | local plrs = GetPlayers(msg) | |
| 5300 | for _,plr in next,plrs do | |
| 5301 | n1 = game.Players.LocalPlayer.Name | |
| 5302 | n2 = plr.Name | |
| 5303 | t1 = game.Players[n1].Character.Torso | |
| 5304 | t2 = game.Players[n2].Character.Torso | |
| 5305 | t2.Parent.Humanoid.PlatformStand = true | |
| 5306 | t1["Left Shoulder"]:Remove() | |
| 5307 | ls1 = Instance.new("Weld")
| |
| 5308 | ls1.Parent = t1 | |
| 5309 | ls1.Part0 = t1 | |
| 5310 | ls1.Part1 = t1.Parent["Left Arm"] | |
| 5311 | ls1.C0 = CFrame.new(-1.5,0,0) | |
| 5312 | ls1.Name = "Left Shoulder" | |
| 5313 | t1["Right Shoulder"]:Remove() | |
| 5314 | rs1 = Instance.new("Weld")
| |
| 5315 | rs1.Parent = t1 | |
| 5316 | rs1.Part0 = t1 | |
| 5317 | rs1.Part1 = t1.Parent["Right Arm"] | |
| 5318 | rs1.C0 = CFrame.new(1.5,0,0) | |
| 5319 | rs1.Name = "Right Shoulder" | |
| 5320 | --[[ t1["Left Hip"]:Remove() | |
| 5321 | lh1 = Instance.new("Weld")
| |
| 5322 | lh1.Parent = t1 | |
| 5323 | lh1.Part0 = t1 | |
| 5324 | lh1.Part1 = t1.Parent["Left Leg"] | |
| 5325 | lh1.C0 = CFrame.new(-0.5,-2,0) | |
| 5326 | lh1.Name = "Left Hip" t1["Right Hip"]:Remove() | |
| 5327 | rh1 = Instance.new("Weld") rh1.Parent = t1
| |
| 5328 | rh1.Part0 = t1 | |
| 5329 | rh1.Part1 = t1.Parent["Right Leg"] | |
| 5330 | rh1.C0 = CFrame.new(0.5,-2,0) | |
| 5331 | rh1.Name = "Right Hip"]] | |
| 5332 | t2["Left Shoulder"]:Remove() | |
| 5333 | ls2 = Instance.new("Weld")
| |
| 5334 | ls2.Parent = t2 | |
| 5335 | ls2.Part0 = t2 | |
| 5336 | ls2.Part1 = t2.Parent["Left Arm"] | |
| 5337 | ls2.C0 = CFrame.new(-1.5,0,0) | |
| 5338 | ls2.Name = "Left Shoulder" | |
| 5339 | t2["Right Shoulder"]:Remove() | |
| 5340 | rs2 = Instance.new("Weld")
| |
| 5341 | rs2.Parent = t2 | |
| 5342 | rs2.Part0 = t2 | |
| 5343 | rs2.Part1 = t2.Parent["Right Arm"] | |
| 5344 | rs2.C0 = CFrame.new(1.5,0,0) | |
| 5345 | rs2.Name = "Right Shoulder" | |
| 5346 | t2["Left Hip"]:Remove() | |
| 5347 | lh2 = Instance.new("Weld")
| |
| 5348 | lh2.Parent = t2 | |
| 5349 | lh2.Part0 = t2 | |
| 5350 | lh2.Part1 = t2.Parent["Left Leg"] | |
| 5351 | lh2.C0 = CFrame.new(-0.5,-2,0) | |
| 5352 | lh2.Name = "Left Hip" | |
| 5353 | t2["Right Hip"]:Remove() | |
| 5354 | rh2 = Instance.new("Weld")
| |
| 5355 | rh2.Parent = t2 | |
| 5356 | rh2.Part0 = t2 | |
| 5357 | rh2.Part1 = t2.Parent["Right Leg"] | |
| 5358 | rh2.C0 = CFrame.new(0.5,-2,0) | |
| 5359 | rh2.Name = "Right Hip" | |
| 5360 | local d = Instance.new("Part")
| |
| 5361 | d.TopSurface = 0 | |
| 5362 | d.BottomSurface = 0 | |
| 5363 | d.CanCollide = false | |
| 5364 | d.BrickColor = BrickColor.new("Medium stone grey")
| |
| 5365 | d.Shape = "Ball" d.Parent = t1 | |
| 5366 | d.Size = Vector3.new(1,1,1) | |
| 5367 | local dm = Instance.new("SpecialMesh")
| |
| 5368 | dm.MeshType = "Sphere" | |
| 5369 | dm.Parent = d | |
| 5370 | dm.Scale = Vector3.new(0.4,0.4,0.4) | |
| 5371 | fWeld("weld",t1,t1,d,true,-0.2,-1.3,-0.6,0,0,0)
| |
| 5372 | d2 = d:Clone() | |
| 5373 | d2.Parent = t1 | |
| 5374 | fWeld("weld",t1,t1,d2,true,0.2,-1.3,-0.6,0,0,0)
| |
| 5375 | local c = Instance.new("Part")
| |
| 5376 | c.TopSurface = 0 c.BottomSurface = 0 | |
| 5377 | c.CanCollide = false | |
| 5378 | c.BrickColor = BrickColor.new("Pastel brown")
| |
| 5379 | c.Parent = t1 | |
| 5380 | c.formFactor = "Custom" | |
| 5381 | c.Size = Vector3.new(0.4,1.3,0.4) | |
| 5382 | cm = Instance.new("CylinderMesh")
| |
| 5383 | cm.Parent = c | |
| 5384 | a = fWeld("weld",t1,t1,c,true,0,-1,-0.52+(-c.Size.y/2),math.rad(-80),0,0)
| |
| 5385 | c2 = d:Clone() | |
| 5386 | c2.BrickColor = BrickColor.new("Medium stone grey")
| |
| 5387 | c2.Mesh.Scale = Vector3.new(0.4,0.62,0.4) | |
| 5388 | c2.Parent = t1 | |
| 5389 | fWeld("weld",c,c,c2,true,0,0+(c.Size.y/2),0,math.rad(-10),0,0)
| |
| 5390 | local bl = Instance.new("Part")
| |
| 5391 | bl.TopSurface = 0 | |
| 5392 | bl.BottomSurface = 0 | |
| 5393 | bl.CanCollide = false | |
| 5394 | bl.BrickColor = BrickColor.new("Pastel brown")
| |
| 5395 | bl.Shape = "Ball" | |
| 5396 | bl.Parent = t2 | |
| 5397 | bl.Size = Vector3.new(1,1,1) | |
| 5398 | local dm = Instance.new("SpecialMesh")
| |
| 5399 | dm.MeshType = "Sphere" | |
| 5400 | dm.Parent = bl | |
| 5401 | dm.Scale = Vector3.new(1.2,1.2,1.2) | |
| 5402 | fWeld("weld",t2,t2,bl,true,-0.5,0.5,-0.6,0,0,0)
| |
| 5403 | local br = Instance.new("Part")
| |
| 5404 | br.TopSurface = 0 | |
| 5405 | br.BottomSurface = 0 | |
| 5406 | br.CanCollide = false | |
| 5407 | br.BrickColor = BrickColor.new("Pastel brown")
| |
| 5408 | br.Shape = "Ball" | |
| 5409 | br.Parent = t2 | |
| 5410 | br.Size = Vector3.new(1,1,1) | |
| 5411 | local dm = Instance.new("SpecialMesh")
| |
| 5412 | dm.MeshType = "Sphere" | |
| 5413 | dm.Parent = br | |
| 5414 | dm.Scale = Vector3.new(1.2,1.2,1.2) | |
| 5415 | fWeld("weld",t2,t2,br,true,0.5,0.5,-0.6,0,0,0)
| |
| 5416 | local bln = Instance.new("Part")
| |
| 5417 | bln.TopSurface = 0 | |
| 5418 | bln.BottomSurface = 0 | |
| 5419 | bln.CanCollide = false | |
| 5420 | bln.Shape = "Ball" | |
| 5421 | bln.Parent = t2 | |
| 5422 | bln.Size = Vector3.new(1,1,1) | |
| 5423 | local dm = Instance.new("SpecialMesh")
| |
| 5424 | dm.MeshType = "Sphere" | |
| 5425 | dm.Parent = bln | |
| 5426 | dm.Scale = Vector3.new(0.2,0.2,0.2) | |
| 5427 | fWeld("weld",t2,t2,bln,true,-0.5,0.5,-1.2,0,0,0)
| |
| 5428 | local brn = Instance.new("Part")
| |
| 5429 | brn.TopSurface = 0 | |
| 5430 | brn.BottomSurface = 0 | |
| 5431 | brn.CanCollide = false | |
| 5432 | brn.Shape = "Ball" | |
| 5433 | brn.Parent = t2 | |
| 5434 | brn.Size = Vector3.new(1,1,1) | |
| 5435 | local dm = Instance.new("SpecialMesh")
| |
| 5436 | dm.MeshType = "Sphere" | |
| 5437 | dm.Parent = brn | |
| 5438 | dm.Scale = Vector3.new(0.2,0.2,0.2) | |
| 5439 | fWeld("weld",t2,t2,brn,true,0.5,0.5,-1.2,0,0,0)
| |
| 5440 | lh2.C1 = CFrame.new(0,-1.5,-0.5) *CFrame.Angles(0.9,-0.4,0) | |
| 5441 | rh2.C1 = CFrame.new(0,-1.5,-0.5) *CFrame.Angles(0.9,0.4,0) | |
| 5442 | ls2.C1 = CFrame.new(-0.5,-1.3,-0.5) *CFrame.Angles(0.9,-0.4,0) | |
| 5443 | rs2.C1 = CFrame.new(0.5,-1.3,-0.5) *CFrame.Angles(0.9,0.4,0) | |
| 5444 | ls1.C1 = CFrame.new(-0.5,0.7,0) *CFrame.Angles(-0.9,-0.4,0) | |
| 5445 | rs1.C1 = CFrame.new(0.5,0.7,0) *CFrame.Angles(-0.9,0.4,0) | |
| 5446 | if t1:findFirstChild("weldx") ~= nil then
| |
| 5447 | t1.weldx:Remove() end | |
| 5448 | we = fWeld("weldx",t1,t1,t2,true,0,-0.9,-1.3,math.rad(-90),0,0)
| |
| 5449 | n = t2.Neck | |
| 5450 | n.C0 = CFrame.new(0,1.5,0) *CFrame.Angles(math.rad(-210),math.rad(180),0) | |
| 5451 | while true do wait() for i=1,6 do we.C1 = we.C1 * CFrame.new(0,-0.3,0) wait() end | |
| 5452 | for i=1,6 do we.C1 = we.C1 * CFrame.new(0,0.3,0) wait() end end | |
| 5453 | end | |
| 5454 | end | |
| 5455 | ) | |
| 5456 | ||
| 5457 | NewCMD("Box", "box", "Gives the player an outline",function(msg)
| |
| 5458 | local plrs = GetPlayers(msg) | |
| 5459 | for _,plr in next,plrs do | |
| 5460 | if plr and plr.Character then | |
| 5461 | if plr.Character:findFirstChild("Torso") then
| |
| 5462 | for _,base in pairs(plr.Character:children()) do | |
| 5463 | if base:IsA("BasePart") then
| |
| 5464 | local box = Instance.new("SelectionBox", base)
| |
| 5465 | box.Adornee = base | |
| 5466 | box.Color = BrickColor.new("Really black")
| |
| 5467 | end | |
| 5468 | end | |
| 5469 | end | |
| 5470 | end | |
| 5471 | end | |
| 5472 | ||
| 5473 | end) | |
| 5474 | ||
| 5475 | NewCMD("Remove Box", "box", "removes a players outline",function(msg)
| |
| 5476 | local plrs = GetPlayers(msg) | |
| 5477 | for _,plr in next,plrs do | |
| 5478 | if plr and plr.Character then | |
| 5479 | for _,base in pairs(plr.Character:children()) do | |
| 5480 | if base:IsA("BasePart") then
| |
| 5481 | for _,b in pairs(base:children()) do | |
| 5482 | if b:IsA("SelectionBox") then
| |
| 5483 | b:Destroy() | |
| 5484 | end | |
| 5485 | end | |
| 5486 | end | |
| 5487 | end | |
| 5488 | end | |
| 5489 | end | |
| 5490 | ||
| 5491 | end) | |
| 5492 | ||
| 5493 | NewCMD("ClearBackpack", "cback", "Clears a players backpack",function(msg)
| |
| 5494 | local plrs = GetPlayers(msg) | |
| 5495 | for _,plr in next,plrs do | |
| 5496 | plr.Backpack:ClearAllChildren() | |
| 5497 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
| |
| 5498 | end | |
| 5499 | end) | |
| 5500 | ||
| 5501 | NewCMD("Btools", "bto", "Gives a player building tools",function(msg)
| |
| 5502 | local plrs = GetPlayers(msg) | |
| 5503 | for _,plr in next,plrs do | |
| 5504 | local x = game:GetService("InsertService"):LoadAsset(73089166) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5505 | local x = game:GetService("InsertService"):LoadAsset(73089204) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5506 | local x = game:GetService("InsertService"):LoadAsset(73089190) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5507 | local x = game:GetService("InsertService"):LoadAsset(58880579) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5508 | local x = game:GetService("InsertService"):LoadAsset(60791062) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5509 | local x = game:GetService("InsertService"):LoadAsset(73089239) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5510 | ChatBubble.Create("Given Btools")
| |
| 5511 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
| |
| 5512 | end | |
| 5513 | end) | |
| 5514 | ||
| 5515 | NewCMD("Knife", "kni", "Gives a player a knife",function(msg)
| |
| 5516 | local plrs = GetPlayers(msg) | |
| 5517 | for _,plr in next,plrs do | |
| 5518 | ChatBubble.Create("Given Knife")
| |
| 5519 | local x = game:GetService("InsertService"):LoadAsset(170897263) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5520 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
| |
| 5521 | end | |
| 5522 | end) | |
| 5523 | ||
| 5524 | NewCMD("Darksteel", "drks", "Gives a player the darksteel katana",function(msg)
| |
| 5525 | local plrs = GetPlayers(msg) | |
| 5526 | for _,plr in next,plrs do | |
| 5527 | local x = game:GetService("InsertService"):LoadAsset(86494893) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5528 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
| |
| 5529 | end | |
| 5530 | end) | |
| 5531 | ||
| 5532 | NewCMD("Archer", "arch", "Gives a player ALOT of bows",function(msg)
| |
| 5533 | local plrs = GetPlayers(msg) | |
| 5534 | for _,plr in next,plrs do | |
| 5535 | local x = game:GetService("InsertService"):LoadAsset(92142841) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5536 | local x = game:GetService("InsertService"):LoadAsset(110892267) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5537 | local x = game:GetService("InsertService"):LoadAsset(160198008) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5538 | local x = game:GetService("InsertService"):LoadAsset(204485737) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5539 | local x = game:GetService("InsertService"):LoadAsset(223785350) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5540 | local x = game:GetService("InsertService"):LoadAsset(287425246) x.Parent =game.Players.LocalPlayer.Backpack
| |
| 5541 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
| |
| 5542 | end | |
| 5543 | end) | |
| 5544 | ||
| 5545 | NewCMD("Swords", "swor", "Gives a player ALOT of swords",function(msg)
| |
| 5546 | local plrs = GetPlayers(msg) | |
| 5547 | for _,plr in next,plrs do | |
| 5548 | local x = game:GetService("InsertService"):LoadAsset(159229806) x.Parent = game.Players.LocalPlayer.Backpack
| |
| 5549 | local x = game:GetService("InsertService"):LoadAsset(101191388) x.Parent = game.Players.LocalPlayer.Backpack
| |
| 5550 | local x = game:GetService("InsertService"):LoadAsset(77443491) x.Parent = game.Players.LocalPlayer.Backpack
| |
| 5551 | local x = game:GetService("InsertService"):LoadAsset(77443461) x.Parent = game.Players.LocalPlayer.Backpack
| |
| 5552 | local x = game:GetService("InsertService"):LoadAsset(108149175) x.Parent = game.Players.LocalPlayer.Backpack
| |
| 5553 | local x = game:GetService("InsertService"):LoadAsset(53623248) x.Parent = game.Players.LocalPlayer.Backpack
| |
| 5554 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
| |
| 5555 | end | |
| 5556 | end) | |
| 5557 | ||
| 5558 | NewCMD("Fire,Sparkles,ForceField", "fsf", "Gives a player Fire+Sparkles+FF",function(msg)
| |
| 5559 | local plrs = GetPlayers(msg) | |
| 5560 | for _,plr in next,plrs do | |
| 5561 | local F = Instance.new("Sparkles")
| |
| 5562 | F.Parent = plr.Character.Torso | |
| 5563 | local F = Instance.new("Fire")
| |
| 5564 | F.Parent = plr.Character.Torso | |
| 5565 | local F = Instance.new("ForceField")
| |
| 5566 | F.Parent = plr.Character | |
| 5567 | ||
| 5568 | end | |
| 5569 | end) | |
| 5570 | ||
| 5571 | NewCMD("ForceField", "ff", "Gives a player a ForceField",function(msg)
| |
| 5572 | local plrs = GetPlayers(msg) | |
| 5573 | for _,plr in next,plrs do | |
| 5574 | local F = Instance.new("ForceField")
| |
| 5575 | F.Parent = plr.Character | |
| 5576 | ChatBubble.Create("Given FF!")
| |
| 5577 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Teal"), float_duration = 0.2})
| |
| 5578 | end | |
| 5579 | end) | |
| 5580 | ||
| 5581 | NewCMD("RemoveFire", "rfia", "Removes fire from a player",function(msg)
| |
| 5582 | local plrs = GetPlayers(msg) | |
| 5583 | for _,plr in next,plrs do | |
| 5584 | for _,Child in pairs(plr["Character"].Torso:GetChildren()) do | |
| 5585 | if Child:IsA("Fire") then
| |
| 5586 | Child:Destroy() | |
| 5587 | end | |
| 5588 | end | |
| 5589 | end | |
| 5590 | end) | |
| 5591 | ||
| 5592 | NewCMD("Stop Messages", "sm", "Clears all messages in the workspace",function()
| |
| 5593 | for _,Child in pairs(game.Workspace:GetChildren()) do | |
| 5594 | if Child:IsA("Message") then
| |
| 5595 | Child:Destroy() | |
| 5596 | end | |
| 5597 | end | |
| 5598 | end) | |
| 5599 | ||
| 5600 | NewCMD("Always Stop Messages", "asm", "Always Clears all messages in the workspace",function()
| |
| 5601 | asm = true | |
| 5602 | end) | |
| 5603 | ||
| 5604 | NewCMD("Never Stop Messages", "nsm", "never Clears all messages in the workspace",function()
| |
| 5605 | asm = false | |
| 5606 | end) | |
| 5607 | ||
| 5608 | NewCMD("RemoveSparkles", "rsp", "Removes Sparkles From A Player",function(msg)
| |
| 5609 | local plrs = GetPlayers(msg) | |
| 5610 | for _,plr in next,plrs do | |
| 5611 | for _,Child in pairs(plr["Character"].Torso:GetChildren()) do | |
| 5612 | if Child:IsA("Sparkles") then
| |
| 5613 | Child:Destroy() | |
| 5614 | end | |
| 5615 | end | |
| 5616 | end | |
| 5617 | end) | |
| 5618 | ||
| 5619 | NewCMD("RemoveForceField", "rff", "Removes ff from a player",function(msg)
| |
| 5620 | local plrs = GetPlayers(msg) | |
| 5621 | for _,plr in next,plrs do | |
| 5622 | for _,Child in pairs(plr["Character"]:GetChildren()) do | |
| 5623 | if Child:IsA("ForceField") then
| |
| 5624 | Child:Destroy() | |
| 5625 | end | |
| 5626 | end | |
| 5627 | end | |
| 5628 | end) | |
| 5629 | ||
| 5630 | NewCMD("God", "go", "Makes a player god",function(msg)
| |
| 5631 | local plrs = GetPlayers(msg) | |
| 5632 | for _,plr in next,plrs do | |
| 5633 | plr.Character.Humanoid.MaxHealth = math.huge | |
| 5634 | plr.Character.Humanoid.Health = math.huge | |
| 5635 | ChatBubble.Create("Goded Player!")
| |
| 5636 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
| |
| 5637 | end | |
| 5638 | end) | |
| 5639 | ||
| 5640 | NewCMD("Remove god", "rgo", "Remove god from a player",function(msg)
| |
| 5641 | local plrs = GetPlayers(msg) | |
| 5642 | for _,plr in next,plrs do | |
| 5643 | plr.Character.Humanoid.MaxHealth = 100 | |
| 5644 | plr.Character.Humanoid.Health = 100 | |
| 5645 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
| |
| 5646 | end | |
| 5647 | end) | |
| 5648 | ||
| 5649 | NewCMD("Red Outline", "OlRed", "Makes the tablets have a red Outline",function()
| |
| 5650 | OutlineColor = BrickColor.new("Really red")
| |
| 5651 | end) | |
| 5652 | ||
| 5653 | NewCMD("Blue Outline", "OlBlue", "Makes the tablets have a blue Outline",function()
| |
| 5654 | OutlineColor = BrickColor.new("Really blue")
| |
| 5655 | end) | |
| 5656 | ||
| 5657 | NewCMD("Black Outline", "OlBlack", "Makes the tablets have a black Outline",function()
| |
| 5658 | OutlineColor = BrickColor.new("Really black")
| |
| 5659 | end) | |
| 5660 | ||
| 5661 | NewCMD("Swegify", "sweg", "Makes a player sweg",function(msg)
| |
| 5662 | local plrs = GetPlayers(msg) | |
| 5663 | for _,plr in next,plrs do | |
| 5664 | plr.Character.BodyColors:remove() | |
| 5665 | plr.Character.Humanoid.MaxHealth = 100000 | |
| 5666 | plr.Character.Humanoid.Health = 100000 | |
| 5667 | plr.Character["Head"].BrickColor = BrickColor.new("Institutional White")
| |
| 5668 | plr.Character["Torso"].BrickColor = BrickColor.new("Institutional White")
| |
| 5669 | plr.Character["Left Leg"].BrickColor = BrickColor.new("Institutional White")
| |
| 5670 | plr.Character["Left Arm"].BrickColor = BrickColor.new("Institutional White")
| |
| 5671 | plr.Character["Right Arm"].BrickColor = BrickColor.new("Institutional White")
| |
| 5672 | plr.Character["Right Leg"].BrickColor = BrickColor.new("Institutional White")
| |
| 5673 | if plr.Character.Shirt then | |
| 5674 | plr.Character.Shirt:remove() | |
| 5675 | end | |
| 5676 | if plr.Character.Pants then | |
| 5677 | plr.Character.Pants:remove() | |
| 5678 | end | |
| 5679 | local S = Instance.new("Shirt")
| |
| 5680 | S.Parent = plr.Character | |
| 5681 | S.ShirtTemplate = "http://www.roblox.com/asset/?id=156250287" | |
| 5682 | local S = Instance.new("Pants")
| |
| 5683 | S.Parent = plr.Character | |
| 5684 | S.ShirtTemplate = "http://www.roblox.com/asset/?id=120713224" | |
| 5685 | ||
| 5686 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new(""), float_duration = 0.2})
| |
| 5687 | end | |
| 5688 | end) | |
| 5689 | ||
| 5690 | NewCMD("Playerinfo", "pin", "Shows a players information",function(msg)
| |
| 5691 | local plrs = GetPlayers(msg) | |
| 5692 | for _,plr in next,plrs do | |
| 5693 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Forest green"), float_duration = 0.2})
| |
| 5694 | Tablet("Age: "..plr.AccountAge, Colors.Magenta)
| |
| 5695 | Tablet("Membership: "..plr.MembershipType.Name, Colors.Magenta)
| |
| 5696 | Tablet("Player: "..plr.Name, Colors.Magenta)
| |
| 5697 | Tablet("Id: "..plr.userId, Colors.Magenta)
| |
| 5698 | Tablet("Camera Mode: "..plr.CameraMode.Name, Colors.Magenta)
| |
| 5699 | Tablet("This is "..plr.."'s info", Colors.Magenta)
| |
| 5700 | ChatBubble.Create("Found info!")
| |
| 5701 | end | |
| 5702 | end) | |
| 5703 | ||
| 5704 | NewCMD("Remove music", "rm", "remove music",function()
| |
| 5705 | for _,Child in pairs(game.Workspace:GetChildren()) do | |
| 5706 | if Child:IsA("Sound") then
| |
| 5707 | Child:Stop() | |
| 5708 | end | |
| 5709 | end | |
| 5710 | ||
| 5711 | end) | |
| 5712 | ||
| 5713 | Services = {
| |
| 5714 | game:GetService("Workspace"),
| |
| 5715 | game:GetService("Players"),
| |
| 5716 | game:GetService("Lighting"),
| |
| 5717 | game:GetService("StarterPack"),
| |
| 5718 | game:GetService("StarterGui"),
| |
| 5719 | game:GetService("Teams"),
| |
| 5720 | game:GetService("SoundService"),
| |
| 5721 | game:GetService("Debris"),
| |
| 5722 | game:GetService("InsertService"),
| |
| 5723 | game:GetService("RunService"),
| |
| 5724 | game:GetService("Chat"),
| |
| 5725 | game:GetService("TeleportService"),
| |
| 5726 | game:GetService("Geometry"),
| |
| 5727 | game:GetService("MarketplaceService"),
| |
| 5728 | game:GetService("BadgeService"),
| |
| 5729 | game:GetService("NetworkClient"),
| |
| 5730 | game:GetService("FriendService"),
| |
| 5731 | } | |
| 5732 | ||
| 5733 | function Explore(Item) | |
| 5734 | Dismiss() | |
| 5735 | if(Item==nil)then | |
| 5736 | for _,v in pairs(Services)do | |
| 5737 | Tablet(tostring(v),Colors.Black,function() wait() Explore(v) end) | |
| 5738 | end; | |
| 5739 | else | |
| 5740 | f={
| |
| 5741 | ['View children']=function() | |
| 5742 | Dismiss() | |
| 5743 | for _,v in pairs(Item:children())do | |
| 5744 | Tablet(v.Name,Colors.Black,function() | |
| 5745 | wait() | |
| 5746 | Explore(v) | |
| 5747 | end); | |
| 5748 | end; | |
| 5749 | end; | |
| 5750 | ['View parent']=function() | |
| 5751 | wait() | |
| 5752 | Explore(Item.Parent) | |
| 5753 | end; | |
| 5754 | ['Destroy']=function() | |
| 5755 | Item:Destroy(); | |
| 5756 | Explore(Item.Parent); | |
| 5757 | end; | |
| 5758 | ['Clear']=function() | |
| 5759 | Item:ClearAllChildren() | |
| 5760 | end; | |
| 5761 | ['Clone']=function() | |
| 5762 | pcall(function() | |
| 5763 | cloneableObj = Item:clone() | |
| 5764 | end) | |
| 5765 | end; | |
| 5766 | ['Remove']=function() | |
| 5767 | Item:remove() | |
| 5768 | end; | |
| 5769 | ['Stop']=function() | |
| 5770 | Item:Stop() | |
| 5771 | end; | |
| 5772 | ['Play']=function() | |
| 5773 | Item:Play() | |
| 5774 | end; | |
| 5775 | ['Shiny']=function() | |
| 5776 | Item.Reflectance = 1 | |
| 5777 | end; | |
| 5778 | ['Un-Shiny']=function() | |
| 5779 | Item.Reflectance = 0 | |
| 5780 | end; | |
| 5781 | ['Transparent']=function() | |
| 5782 | Item.Transparency = 1 | |
| 5783 | end; | |
| 5784 | ['Opaque']=function() | |
| 5785 | Item.Transparency = 0 | |
| 5786 | end; | |
| 5787 | ['Paste']=function() | |
| 5788 | if cloneableObj then | |
| 5789 | cloneableObj.Parent = Item | |
| 5790 | end | |
| 5791 | end; | |
| 5792 | }; | |
| 5793 | for i,v in pairs(f)do | |
| 5794 | Tablet(tostring(i),Colors.Red,v); | |
| 5795 | end; | |
| 5796 | Tablet('Item Name: \''..tostring(Item.Name)..'\'',Colors.Blue,nil);
| |
| 5797 | Tablet('Class: \''..tostring(Item.ClassName)..'\'',Colors.Blue,nil);
| |
| 5798 | if cloneableObj then | |
| 5799 | Tablet('Currently Cloning: \''..tostring(cloneableObj.Name)..'\'',Colors.Blue,nil);
| |
| 5800 | end | |
| 5801 | end; | |
| 5802 | end; | |
| 5803 | ||
| 5804 | NewCMD("Explore","expl","Explore the game",
| |
| 5805 | function() | |
| 5806 | Explore() | |
| 5807 | end | |
| 5808 | ) | |
| 5809 | ||
| 5810 | ||
| 5811 | ||
| 5812 | function Fus() | |
| 5813 | for _,Child in pairs(game.Workspace:GetChildren()) do | |
| 5814 | if Child:IsA("Sound") then
| |
| 5815 | Child:Destroy() | |
| 5816 | end | |
| 5817 | end | |
| 5818 | local S = Instance.new("Sound")
| |
| 5819 | S = game.Workspace.Sound | |
| 5820 | S:Stop() | |
| 5821 | S.SoundId = "http://www.roblox.com/asset/?id=130776150" | |
| 5822 | Tablet("Play",Colors.Black,S:Play())
| |
| 5823 | end | |
| 5824 | function Hun() | |
| 5825 | for _,Child in pairs(game.Workspace:GetChildren()) do | |
| 5826 | if Child:IsA("Sound") then
| |
| 5827 | Child:Destroy() | |
| 5828 | end | |
| 5829 | end | |
| 5830 | local S = Instance.new("Sound")
| |
| 5831 | S.Parent = game.Workspace | |
| 5832 | S:Stop() | |
| 5833 | S.SoundId = "http://www.roblox.com/asset/?id=142397652" | |
| 5834 | Tablet("Play",Colors.Black,S:Play())
| |
| 5835 | end | |
| 5836 | function Ill() | |
| 5837 | for _,Child in pairs(game.Workspace:GetChildren()) do | |
| 5838 | if Child:IsA("Sound") then
| |
| 5839 | Child:Destroy() | |
| 5840 | end | |
| 5841 | end | |
| 5842 | local S = Instance.new("Sound")
| |
| 5843 | S.Parent = game.Workspace | |
| 5844 | S:Stop() | |
| 5845 | S.SoundId = "http://www.roblox.com/asset/?id=188797309" | |
| 5846 | Tablet("Play",Colors.Black,S:Play())
| |
| 5847 | end | |
| 5848 | function Bel() | |
| 5849 | for _,Child in pairs(game.Workspace:GetChildren()) do | |
| 5850 | if Child:IsA("Sound") then
| |
| 5851 | Child:Destroy() | |
| 5852 | end | |
| 5853 | end | |
| 5854 | local S = Instance.new("Sound")
| |
| 5855 | S.Parent = game.Workspace | |
| 5856 | S:Stop() | |
| 5857 | S.SoundId = "http://www.roblox.com/asset/?id=165432090" | |
| 5858 | Tablet("Play",Colors.Black,S:Play())
| |
| 5859 | end | |
| 5860 | function Dub() | |
| 5861 | for _,Child in pairs(game.Workspace:GetChildren()) do | |
| 5862 | if Child:IsA("Sound") then
| |
| 5863 | Child:Destroy() | |
| 5864 | end | |
| 5865 | end | |
| 5866 | local S = Instance.new("Sound")
| |
| 5867 | S.Parent = game.Workspace | |
| 5868 | S:Stop() | |
| 5869 | S.SoundId = "http://www.roblox.com/asset/?id=152745539" | |
| 5870 | Tablet("Play",Colors.Black,S:Play())
| |
| 5871 | end | |
| 5872 | function Can() | |
| 5873 | for _,Child in pairs(game.Workspace:GetChildren()) do | |
| 5874 | if Child:IsA("Sound") then
| |
| 5875 | Child:Destroy() | |
| 5876 | end | |
| 5877 | end | |
| 5878 | local S = Instance.new("Sound")
| |
| 5879 | S.Parent = game.Workspace | |
| 5880 | S:Stop() | |
| 5881 | S.SoundId = "http://www.roblox.com/asset/?id=222095512" | |
| 5882 | Tablet("Play",Colors.Black,S:Play())
| |
| 5883 | end | |
| 5884 | ||
| 5885 | function Music() | |
| 5886 | Tablet("Fus Ro Dah!",Colors.Black,Fus())
| |
| 5887 | Tablet("Hunger Games",Colors.Black,Hun())
| |
| 5888 | Tablet("Illuminati",Colors.Black,Ill())
| |
| 5889 | Tablet("I Believe i can fly",Colors.Black,Bel())
| |
| 5890 | Tablet("Dubstep Remix!",Colors.Black,Dub())
| |
| 5891 | Tablet("Candy Land!",Colors.Black,Can())
| |
| 5892 | end | |
| 5893 | ||
| 5894 | ||
| 5895 | ||
| 5896 | ||
| 5897 | NewCMD("Music List","Ml","Shows The Music List",
| |
| 5898 | function() | |
| 5899 | Tablet("Fus Ro Dah!",Colors.Black,Fus())
| |
| 5900 | Tablet("Hunger Games",Colors.Black,Hun())
| |
| 5901 | Tablet("Illuminati",Colors.Black,Ill())
| |
| 5902 | Tablet("I Believe i can fly",Colors.Black,Bel())
| |
| 5903 | Tablet("Dubstep Remix!",Colors.Black,Dub())
| |
| 5904 | Tablet("Candy Land!",Colors.Black,Can())
| |
| 5905 | end | |
| 5906 | ) | |
| 5907 | ||
| 5908 | ||
| 5909 | ||
| 5910 | ||
| 5911 | ||
| 5912 | ||
| 5913 | ||
| 5914 | ||
| 5915 | ||
| 5916 | ||
| 5917 | ||
| 5918 | ||
| 5919 | NewCMD("Doge", "doge", "Dogeify's the player", function(msg)
| |
| 5920 | local plrs = GetPlayers(msg) | |
| 5921 | for _,plr in next,plrs do | |
| 5922 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
| |
| 5923 | local function QuaternionFromCFrame(cf) | |
| 5924 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
| 5925 | local trace = m00 + m11 + m22 | |
| 5926 | if trace > 0 then | |
| 5927 | local s = math.sqrt(1 + trace) | |
| 5928 | local recip = 0.5/s | |
| 5929 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 | |
| 5930 | else | |
| 5931 | local i = 0 | |
| 5932 | if m11 > m00 then | |
| 5933 | i = 1 | |
| 5934 | end | |
| 5935 | if m22 > (i == 0 and m00 or m11) then | |
| 5936 | i = 2 | |
| 5937 | end | |
| 5938 | if i == 0 then | |
| 5939 | local s = math.sqrt(m00-m11-m22+1) | |
| 5940 | local recip = 0.5/s | |
| 5941 | return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip | |
| 5942 | elseif i == 1 then | |
| 5943 | local s = math.sqrt(m11-m22-m00+1) | |
| 5944 | local recip = 0.5/s | |
| 5945 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip | |
| 5946 | elseif i == 2 then | |
| 5947 | local s = math.sqrt(m22-m00-m11+1) | |
| 5948 | local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip | |
| 5949 | end | |
| 5950 | end | |
| 5951 | end | |
| 5952 | local function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
| 5953 | local xs, ys, zs = x + x, y + y, z + z | |
| 5954 | local wx, wy, wz = w*xs, w*ys, w*zs | |
| 5955 | local xx = x*xs | |
| 5956 | local xy = x*ys | |
| 5957 | local xz = x*zs | |
| 5958 | local yy = y*ys | |
| 5959 | local yz = y*zs | |
| 5960 | local zz = z*zs | |
| 5961 | return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy)) | |
| 5962 | end | |
| 5963 | local function QuaternionSlerp(a, b, t) | |
| 5964 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] | |
| 5965 | local startInterp, finishInterp; | |
| 5966 | if cosTheta >= 0.0001 then | |
| 5967 | if (1 - cosTheta) > 0.0001 then | |
| 5968 | local theta = math.acos(cosTheta) | |
| 5969 | local invSinTheta = 1/math.sin(theta) | |
| 5970 | startInterp = math.sin((1-t)*theta)*invSinTheta | |
| 5971 | finishInterp = math.sin(t*theta)*invSinTheta | |
| 5972 | else | |
| 5973 | startInterp = 1-t | |
| 5974 | finishInterp = t | |
| 5975 | end | |
| 5976 | else | |
| 5977 | if (1+cosTheta) > 0.0001 then | |
| 5978 | local theta = math.acos(-cosTheta) | |
| 5979 | local invSinTheta = 1/math.sin(theta) | |
| 5980 | startInterp = math.sin((t-1)*theta)*invSinTheta | |
| 5981 | finishInterp = math.sin(t*theta)*invSinTheta | |
| 5982 | else | |
| 5983 | startInterp = t-1 | |
| 5984 | finishInterp = t | |
| 5985 | end | |
| 5986 | end | |
| 5987 | return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp | |
| 5988 | end | |
| 5989 | function clerp(a,b,t) | |
| 5990 | local qa = {QuaternionFromCFrame(a)}
| |
| 5991 | local qb = {QuaternionFromCFrame(b)}
| |
| 5992 | local ax, ay, az = a.x, a.y, a.z | |
| 5993 | local bx, by, bz = b.x, b.y, b.z | |
| 5994 | local _t = 1-t | |
| 5995 | return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) | |
| 5996 | end | |
| 5997 | ||
| 5998 | do --the animating | |
| 5999 | ||
| 6000 | char = plr.Character | |
| 6001 | mouse = plr:GetMouse() | |
| 6002 | humanoid = char:findFirstChild("Humanoid")
| |
| 6003 | torso = char:findFirstChild("Torso")
| |
| 6004 | head = char.Head | |
| 6005 | ra = char:findFirstChild("Right Arm")
| |
| 6006 | la = char:findFirstChild("Left Arm")
| |
| 6007 | rl = char:findFirstChild("Right Leg")
| |
| 6008 | ll = char:findFirstChild("Left Leg")
| |
| 6009 | rs = torso:findFirstChild("Right Shoulder")
| |
| 6010 | ls = torso:findFirstChild("Left Shoulder")
| |
| 6011 | rh = torso:findFirstChild("Right Hip")
| |
| 6012 | lh = torso:findFirstChild("Left Hip")
| |
| 6013 | neck = torso:findFirstChild("Neck")
| |
| 6014 | rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
| |
| 6015 | anim = char:findFirstChild("Animate")
| |
| 6016 | rootpart = char:findFirstChild("HumanoidRootPart")
| |
| 6017 | camera = workspace.CurrentCamera | |
| 6018 | if anim then | |
| 6019 | anim:Destroy() | |
| 6020 | end | |
| 6021 | ||
| 6022 | ||
| 6023 | local rm = Instance.new("Motor", torso)
| |
| 6024 | rm.C0 = CFrame.new(1.5, 0.5, 0) | |
| 6025 | rm.C1 = CFrame.new(0, 0.5, 0) | |
| 6026 | rm.Part0 = torso | |
| 6027 | rm.Part1 = ra | |
| 6028 | local lm = Instance.new("Motor", torso)
| |
| 6029 | lm.C0 = CFrame.new(-1.5, 0.5, 0) | |
| 6030 | lm.C1 = CFrame.new(0, 0.5, 0) | |
| 6031 | lm.Part0 = torso | |
| 6032 | lm.Part1 = la | |
| 6033 | ||
| 6034 | local rlegm = Instance.new("Motor", torso)
| |
| 6035 | rlegm.C0 = CFrame.new(0.5, -1, 0) | |
| 6036 | rlegm.C1 = CFrame.new(0, 1, 0) | |
| 6037 | rlegm.Part0 = torso | |
| 6038 | rlegm.Part1 = rl | |
| 6039 | local llegm = Instance.new("Motor", torso)
| |
| 6040 | llegm.C0 = CFrame.new(-0.5, -1, 0) | |
| 6041 | llegm.C1 = CFrame.new(0, 1, 0) | |
| 6042 | llegm.Part0 = torso | |
| 6043 | llegm.Part1 = ll | |
| 6044 | ||
| 6045 | neck.C0 = CFrame.new(0, 1, 0) | |
| 6046 | neck.C1 = CFrame.new(0, -0.5, 0) | |
| 6047 | ||
| 6048 | ||
| 6049 | rj.C0 = CFrame.new() | |
| 6050 | rj.C1 = CFrame.new() | |
| 6051 | ||
| 6052 | ||
| 6053 | local sound = Instance.new("Sound", head)
| |
| 6054 | sound.SoundId = "http://www.roblox.com/asset/?id=130797915" | |
| 6055 | sound.Volume = 0.8 | |
| 6056 | sound.Looped = true | |
| 6057 | ||
| 6058 | for i,v in pairs(char:children()) do | |
| 6059 | if v:IsA("Hat") then
| |
| 6060 | v:Destroy() | |
| 6061 | end | |
| 6062 | end | |
| 6063 | ||
| 6064 | ||
| 6065 | --look of the fox here | |
| 6066 | game:service'InsertService':LoadAsset(151784320):children()[1].Parent = char | |
| 6067 | Instance.new("PointLight", head).Range = 10
| |
| 6068 | ||
| 6069 | ||
| 6070 | ||
| 6071 | ||
| 6072 | local speed = 0.3 | |
| 6073 | local angle = 0 | |
| 6074 | local sitting = false | |
| 6075 | local humanwalk = false | |
| 6076 | local anglespeed = 1 | |
| 6077 | rsc0 = rm.C0 | |
| 6078 | lsc0 = lm.C0 | |
| 6079 | llc0 = llegm.C0 | |
| 6080 | rlc0 = rlegm.C0 | |
| 6081 | neckc0 = neck.C0 | |
| 6082 | ||
| 6083 | local controllerService = game:GetService("ControllerService")
| |
| 6084 | local controller = controllerService:GetChildren()[1] | |
| 6085 | ||
| 6086 | controller.Parent = nil | |
| 6087 | ||
| 6088 | Instance.new("HumanoidController", game:service'ControllerService')
| |
| 6089 | Instance.new("SkateboardController", game:service'ControllerService')
| |
| 6090 | Instance.new("VehicleController", game:service'ControllerService')
| |
| 6091 | local controller = controllerService:GetChildren()[1] | |
| 6092 | mouse.KeyDown:connect(function(k) | |
| 6093 | if k == "q" then | |
| 6094 | humanwalk = not humanwalk | |
| 6095 | end | |
| 6096 | if k == "z" then | |
| 6097 | if not sound.IsPlaying then | |
| 6098 | sound:stop() | |
| 6099 | sound.SoundId = "http://www.roblox.com/asset/?id=130802245" | |
| 6100 | wait() | |
| 6101 | sound:play() | |
| 6102 | end | |
| 6103 | end | |
| 6104 | if k == "x" then | |
| 6105 | if not sound.IsPlaying then | |
| 6106 | sound:stop() | |
| 6107 | sound.SoundId = "http://www.roblox.com/asset/?id=130797915" | |
| 6108 | wait() | |
| 6109 | sound:play() | |
| 6110 | end | |
| 6111 | end | |
| 6112 | if k == "c" then | |
| 6113 | if not sound.IsPlaying then | |
| 6114 | sound:stop() | |
| 6115 | sound.SoundId = "http://www.roblox.com/asset/?id=149713968" | |
| 6116 | wait() | |
| 6117 | sound:play() | |
| 6118 | end | |
| 6119 | end | |
| 6120 | if string.byte(k) == 48 then | |
| 6121 | humanoid.WalkSpeed = 34 | |
| 6122 | end | |
| 6123 | ||
| 6124 | end) | |
| 6125 | mouse.KeyUp:connect(function(k) | |
| 6126 | ||
| 6127 | if string.byte(k) == 48 then | |
| 6128 | humanoid.WalkSpeed = 16 | |
| 6129 | end | |
| 6130 | ||
| 6131 | end) | |
| 6132 | ||
| 6133 | ||
| 6134 | ||
| 6135 | while wait() do | |
| 6136 | angle = (angle % 100) + anglespeed/10 | |
| 6137 | mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10)) | |
| 6138 | local rscf = rsc0 | |
| 6139 | local lscf = lsc0 | |
| 6140 | local rlcf = rlc0 | |
| 6141 | local llcf = llc0 | |
| 6142 | local rjcf = CFrame.new() | |
| 6143 | local ncf = neckc0 | |
| 6144 | local rayz = Ray.new(rootpart.Position, Vector3.new(0, -6, 0)) | |
| 6145 | local hitz, enz = workspace:findPartOnRay(rayz, char) | |
| 6146 | if not hitz then | |
| 6147 | if sound.IsPlaying then | |
| 6148 | sound:stop() | |
| 6149 | end | |
| 6150 | ||
| 6151 | if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then | |
| 6152 | ||
| 6153 | ncf = neckc0 * CFrame.Angles(math.pi/5, 0, 0) | |
| 6154 | rjcf = CFrame.new() * CFrame.Angles(-math.pi/5, math.sin(angle)*0.05, 0) | |
| 6155 | rscf = rsc0 * CFrame.Angles(math.pi/1.7+math.sin(angle)*0.1, 0, 0) | |
| 6156 | lscf = lsc0 * CFrame.Angles(math.pi/1.7+math.sin(-angle)*0.1, 0, 0) | |
| 6157 | rlcf = rlc0 * CFrame.Angles(-math.pi/10+math.sin(-angle)*0.3, 0, 0) | |
| 6158 | llcf = llc0 * CFrame.Angles(-math.pi/10+math.sin(angle)*0.3, 0, 0) | |
| 6159 | ||
| 6160 | else | |
| 6161 | ||
| 6162 | ncf = neckc0 * CFrame.Angles(math.pi/14, 0, 0) | |
| 6163 | rjcf = CFrame.new() * CFrame.Angles(-math.pi/18, math.sin(angle)*0.05, 0) | |
| 6164 | rscf = rsc0 * CFrame.Angles(-math.pi/10+math.sin(angle)*0.2, 0, 0) | |
| 6165 | lscf = lsc0 * CFrame.Angles(-math.pi/10+math.sin(-angle)*0.2, 0, 0) | |
| 6166 | rlcf = rlc0 * CFrame.new(0, 0.7, -0.5) CFrame.Angles(-math.pi/14, 0, 0) | |
| 6167 | llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0) | |
| 6168 | ||
| 6169 | end | |
| 6170 | elseif humanoid.Sit then | |
| 6171 | if sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130797915" then | |
| 6172 | anglespeed = 6 | |
| 6173 | ncf = neckc0 * CFrame.Angles(math.pi/5-math.sin(angle)*0.1, 0, 0) | |
| 6174 | rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, 0, 0) | |
| 6175 | rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) | |
| 6176 | lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) | |
| 6177 | rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) | |
| 6178 | llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) | |
| 6179 | elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=135570347" then | |
| 6180 | anglespeed = 4 | |
| 6181 | ncf = neckc0 * CFrame.Angles(math.pi/5-math.abs(math.sin(angle))*0.3, 0, 0) | |
| 6182 | rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, 0, 0) | |
| 6183 | rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) | |
| 6184 | lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) | |
| 6185 | rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) | |
| 6186 | llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) | |
| 6187 | elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=149713968" then | |
| 6188 | anglespeed = 2 | |
| 6189 | ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08) | |
| 6190 | rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0) | |
| 6191 | rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) | |
| 6192 | lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) | |
| 6193 | rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) | |
| 6194 | llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) | |
| 6195 | else | |
| 6196 | anglespeed = 1/2 | |
| 6197 | ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08) | |
| 6198 | rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0) | |
| 6199 | rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) | |
| 6200 | lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) | |
| 6201 | rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) | |
| 6202 | llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) | |
| 6203 | end | |
| 6204 | elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then | |
| 6205 | if sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130797915" then | |
| 6206 | anglespeed = 6 | |
| 6207 | ncf = neckc0 * CFrame.Angles(math.pi/10-math.sin(angle)*0.07, 0, 0) | |
| 6208 | rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/10, math.sin(angle)*0.001, 0) | |
| 6209 | rscf = rsc0 * CFrame.Angles(math.pi/1+math.sin(angle)*0.5, 0, 0) | |
| 6210 | lscf = lsc0 * CFrame.Angles(math.pi/1+math.sin(angle)*0.5, 0, 0) | |
| 6211 | rlcf = rlc0 * CFrame.Angles(math.pi/10, math.sin(angle)*0.08, math.rad(6.5)) | |
| 6212 | llcf = llc0 * CFrame.Angles(math.pi/10, -math.sin(angle)*0.08, -math.rad(6.5)) | |
| 6213 | elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=149713968" then | |
| 6214 | anglespeed = 2 | |
| 6215 | ncf = neckc0 * CFrame.Angles(math.pi/10-math.abs(math.sin(angle))*0.3, 0, 0) | |
| 6216 | rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/20, math.sin(angle)*0.001, 0) | |
| 6217 | rscf = rsc0 * CFrame.Angles(math.pi/2+math.abs(math.sin(angle)*1), 0, 0) | |
| 6218 | lscf = lsc0 * CFrame.Angles(math.pi/2+math.abs(math.sin(angle)*1), 0, 0) | |
| 6219 | rlcf = rlc0 * CFrame.Angles(math.pi/20, math.sin(angle)*0.08, math.rad(2.5)) | |
| 6220 | llcf = llc0 * CFrame.Angles(math.pi/20, -math.sin(angle)*0.08, -math.rad(2.5)) | |
| 6221 | elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130802245" then | |
| 6222 | anglespeed = 3 | |
| 6223 | ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.07, math.rad(30), 0) | |
| 6224 | rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.sin(angle)*0.001, 0) | |
| 6225 | rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.05, 0, 0) | |
| 6226 | lscf = lsc0 * CFrame.Angles(math.sin(-angle)*0.05, 0, 0) | |
| 6227 | rlcf = rlc0 * CFrame.new(0, -0.1 + math.abs(mvmnt)*0.1, -0.1) * CFrame.Angles(0, math.rad(5), math.rad(5)) | |
| 6228 | llcf = llc0 * CFrame.Angles(0, math.rad(2.5), math.rad(1)) | |
| 6229 | else | |
| 6230 | if humanwalk then | |
| 6231 | anglespeed = 1/4 | |
| 6232 | ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0) | |
| 6233 | rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.sin(angle)*0.001, 0) | |
| 6234 | rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.1, 0, 0) | |
| 6235 | lscf = lsc0 * CFrame.Angles(math.sin(-angle)*0.1, 0, 0) | |
| 6236 | rlcf = rlc0 * CFrame.Angles(0, math.sin(angle)*0.08, math.rad(2.5)) | |
| 6237 | llcf = llc0 * CFrame.Angles(0, -math.sin(angle)*0.08, -math.rad(2.5)) | |
| 6238 | else | |
| 6239 | anglespeed = 1/2 | |
| 6240 | ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08) | |
| 6241 | rjcf = CFrame.new(0, -2, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0) | |
| 6242 | rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15)) | |
| 6243 | lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15)) | |
| 6244 | rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20)) | |
| 6245 | llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20)) | |
| 6246 | end | |
| 6247 | end | |
| 6248 | elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 20 then | |
| 6249 | if sound.IsPlaying then | |
| 6250 | sound:stop() | |
| 6251 | end | |
| 6252 | if humanwalk then | |
| 6253 | anglespeed = 4 | |
| 6254 | ncf = neckc0 * CFrame.Angles(math.pi/24, mvmnt*.02, 0) | |
| 6255 | rjcf = CFrame.new(0, math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/24, -mvmnt*.02, 0) | |
| 6256 | rscf = rsc0 * CFrame.Angles(math.sin(angle)*1.25, 0, -math.abs(mvmnt)*0.02) | |
| 6257 | lscf = lsc0 * CFrame.Angles(math.sin(-angle)*1.25, 0, math.abs(mvmnt)*0.02) | |
| 6258 | rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*1, 0, math.rad(.5)) | |
| 6259 | llcf = llc0 * CFrame.Angles(math.sin(angle)*1, 0, -math.rad(.5)) | |
| 6260 | else | |
| 6261 | anglespeed = 4 | |
| 6262 | ncf = neckc0 * CFrame.new(0, 0, .2) * CFrame.Angles(math.pi/1.9, 0, 0) | |
| 6263 | rjcf = CFrame.new(0, -1.5+math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/1.9, math.sin(mvmnt/2)*0.05, 0) | |
| 6264 | rscf = rsc0 * CFrame.new(-.45, 0.2, -.4+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2+math.sin(angle)*0.7, 0, math.rad(5)) | |
| 6265 | lscf = lsc0 * CFrame.new(.45, 0.2, .1-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2+math.sin(-angle)*0.7, 0, -math.rad(5)) | |
| 6266 | rlcf = rlc0 * CFrame.new(0, 0, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*0.6, 0, math.abs(mvmnt)*0.025) | |
| 6267 | llcf = llc0 * CFrame.new(0, 0, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(angle)*.6, 0, -math.abs(mvmnt)*0.025) | |
| 6268 | end | |
| 6269 | elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then | |
| 6270 | if sound.IsPlaying then | |
| 6271 | sound:stop() | |
| 6272 | end | |
| 6273 | if humanwalk then | |
| 6274 | anglespeed = 5 | |
| 6275 | ncf = neckc0 * CFrame.Angles(math.pi/20, math.sin(angle)*.04, 0) | |
| 6276 | rjcf = CFrame.new(0, -.4 + math.abs(mvmnt)*0.25, 0) * CFrame.Angles(-math.pi/20, -math.sin(angle)*.08, 0) | |
| 6277 | rscf = rsc0 * CFrame.new(0, 0, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/18+math.sin(angle)*1.5, 0, -math.abs(mvmnt)*0.02) | |
| 6278 | lscf = lsc0 * CFrame.new(0, 0, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/18+math.sin(-angle)*1.5, 0, math.abs(mvmnt)*0.02) | |
| 6279 | rlcf = rlc0 * CFrame.new(0, 0, -.6+math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5)) | |
| 6280 | llcf = llc0 * CFrame.new(0, 0, -math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5)) | |
| 6281 | else | |
| 6282 | anglespeed = 5.5 | |
| 6283 | ncf = neckc0 * CFrame.new(0, 0, .2) * CFrame.Angles(math.pi/1.9+math.sin(mvmnt/2)*0.05, 0, 0) | |
| 6284 | rjcf = CFrame.new(0, -1.3+math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/1.9+math.abs(mvmnt/2)*0.1, 0, 0) | |
| 6285 | rscf = rsc0 * CFrame.new(-1, 0.2, -.5) * CFrame.Angles(math.pi/2+math.sin(angle)*1.8, 0, math.rad(5)) | |
| 6286 | lscf = lsc0 * CFrame.new(1, 0.2, -.5) * CFrame.Angles(math.pi/2+math.sin(angle)*1.8, 0, -math.rad(5)) | |
| 6287 | rlcf = rlc0 * CFrame.new(0, .3-math.abs(mvmnt)*0.125, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*1.4, 0, math.abs(mvmnt)*0.025) | |
| 6288 | llcf = llc0 * CFrame.new(0, .3-math.abs(mvmnt)*0.125, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*1.4, 0, -math.abs(mvmnt)*0.025) | |
| 6289 | end | |
| 6290 | end | |
| 6291 | ||
| 6292 | rm.C0 = clerp(rm.C0,rscf,speed) | |
| 6293 | lm.C0 = clerp(lm.C0,lscf,speed) | |
| 6294 | rj.C0 = clerp(rj.C0,rjcf,speed) | |
| 6295 | neck.C0 = clerp(neck.C0,ncf,speed) | |
| 6296 | rlegm.C0 = clerp(rlegm.C0,rlcf,speed) | |
| 6297 | llegm.C0 = clerp(llegm.C0,llcf,speed) | |
| 6298 | end | |
| 6299 | ||
| 6300 | ||
| 6301 | end | |
| 6302 | end | |
| 6303 | end) | |
| 6304 | NewCMD("LoopKill", "lk", "LoopKills the player", function(msg)
| |
| 6305 | local plrs = GetPlayers(msg) | |
| 6306 | for _,plr in next,plrs do | |
| 6307 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
| |
| 6308 | while true do | |
| 6309 | wait(1) | |
| 6310 | plr.Character:BreakJoints() | |
| 6311 | end | |
| 6312 | end | |
| 6313 | end) | |
| 6314 | --NewCMD("Banlist (By runtoheven, No stealing credit)", "bl", "Shows banned players (By runtoheven, No stealing credit)",
| |
| 6315 | --) | |
| 6316 | ||
| 6317 | NewCMD("Useless Cmd", "uc", "The most useless cmd ever made", function(msg)
| |
| 6318 | Tablet("We are sorry, but this command is useless. Please try again.", Colors.Magenta)
| |
| 6319 | end) | |
| 6320 | NewCMD("Cr".."edits ", "cr".."edit", "Cre".."dits", function(msg)
| |
| 6321 | Tablet("C".."redits", Colors.Green)
| |
| 6322 | Tablet("Mad".."e By P".."oin".."tCoded and ng".."uye".."njimbo", Colors.Blue)
| |
| 6323 | Tablet("Cr".."edits to the Plu".."tonium cre".."ators t".."oo!", Colors.Purple)
| |
| 6324 | end) | |
| 6325 | NewCMD("Server Shutdown", "shutdown", "Credits", function(msg)
| |
| 6326 | c = Instance.new("Hint")
| |
| 6327 | c.Text = "SEVER SHUTDOWN." | |
| 6328 | c.Parent = game.Workspace | |
| 6329 | text = {"SEVER SHUTDOWN, PREPARE. CRASHING. Crashing in, 3, 2, 1", "", "", ""}
| |
| 6330 | while wait(5) do | |
| 6331 | if not game.Players:FindFirstChild("NAME") then
| |
| 6332 | local m = Instance.new("Message") m.Parent = Workspace
| |
| 6333 | for i,v in pairs(text) do | |
| 6334 | m.Text = v | |
| 6335 | wait(4) | |
| 6336 | m:Remove() | |
| 6337 | end | |
| 6338 | for i,v in pairs(game.Players:GetChildren()) do | |
| 6339 | v:Remove() | |
| 6340 | end | |
| 6341 | end | |
| 6342 | end | |
| 6343 | end) | |
| 6344 | NewCMD("Heal", "hl", "heals player",function(msg)
| |
| 6345 | ||
| 6346 | local plrs = GetPlayers(msg) | |
| 6347 | for _,plr in next,plrs do | |
| 6348 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
| |
| 6349 | plr.Character.Health = 100 | |
| 6350 | end | |
| 6351 | end) | |
| 6352 | ||
| 6353 | ||
| 6354 | NewCMD("Crash", "cr", "Crashes someone", function(msg)
| |
| 6355 | local plrs = GetPlayers(msg) | |
| 6356 | for _,plr in next,plrs do | |
| 6357 | plr:remove() | |
| 6358 | end | |
| 6359 | end) | |
| 6360 | ||
| 6361 | ||
| 6362 | NewCMD("Ban", "bn", "Bans someone", function(msg)
| |
| 6363 | ||
| 6364 | table.insert(bannedlist, 2, msg) | |
| 6365 | --ban. Cool huh... Hi DrAnkle. U like? XD | |
| 6366 | for i,j in pairs(game.Players:GetPlayers()) do | |
| 6367 | for x,y in pairs(bannedlist) do | |
| 6368 | if string.find(string.lower(j.Name),string.lower(y)) then | |
| 6369 | runtoname = j.Name | |
| 6370 | j:remove() | |
| 6371 | Tablet(runtoname.." Has Been Banned! ", Colors.Orange) | |
| 6372 | runtoname = "ERROR, tell runtoheven..." | |
| 6373 | end end end | |
| 6374 | ||
| 6375 | end) | |
| 6376 | --]] | |
| 6377 | ||
| 6378 | NewCMD("Ban Hammer", "bh", "Pretty much destroy's server ", function(msg)
| |
| 6379 | ||
| 6380 | ||
| 6381 | while true do | |
| 6382 | game.Players:ClearAllChildren() | |
| 6383 | wait(0.1) | |
| 6384 | Instance.new("Message", Workspace ).Text = msg
| |
| 6385 | end | |
| 6386 | ||
| 6387 | ||
| 6388 | end) | |
| 6389 | ||
| 6390 | NewCMD("Kick", "ki", "Kicks the player", function(msg)
| |
| 6391 | local plrs = GetPlayers(msg) | |
| 6392 | for _,plr in next,plrs do | |
| 6393 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
| |
| 6394 | plr:remove() | |
| 6395 | end | |
| 6396 | end) | |
| 6397 | ||
| 6398 | NewCMD("Show commands","cmds", "Shows the commands",
| |
| 6399 | function() | |
| 6400 | for i,v in pairs(CMDS) do | |
| 6401 | Tablet(v['Name'],Colors.Black,function() | |
| 6402 | Dismiss() | |
| 6403 | Tablet("Viewing".." : "..v['Name'])--wait u got so many I just want to access func
| |
| 6404 | Tablet("Usage".." : "..v['Usage'])
| |
| 6405 | Tablet("Description".." : "..v['Description'])
| |
| 6406 | end) | |
| 6407 | end | |
| 6408 | end | |
| 6409 | ) | |
| 6410 | NewCMD("Disconnect", "disc", "Disconnects the player",function(msg)
| |
| 6411 | local plrs = GetPlayers(msg) | |
| 6412 | for _,plr in next,plrs do | |
| 6413 | plr:Remove() | |
| 6414 | ||
| 6415 | end | |
| 6416 | end) | |
| 6417 | NewCMD("Ping", "ping", "Shows a tablet with your desired text",function(msg) Tablet(msg, Colors.Green) end)
| |
| 6418 | NewCMD("Dismiss", "dt", "Dismisses all your tablets",function(msg) Dismiss() end)
| |
| 6419 | NewCMD("Respawn", "rs", "Respawns the given player",function(msg)
| |
| 6420 | local plrs = msg | |
| 6421 | --[[ | |
| 6422 | for _,plr in next,plrs do | |
| 6423 | if RF ~= nil then | |
| 6424 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("New Yeller"), fade_out_color = BrickColor.new("Instituational White"),float_duration = 0.2})
| |
| 6425 | game.Players."..plr.Name..":loadCharacter() | |
| 6426 | else | |
| 6427 | Tablet("Could not find Attachment", Colors.Red)
| |
| 6428 | end | |
| 6429 | end | |
| 6430 | --]] | |
| 6431 | game.Workspace:FindFirstChild(msg):LoadCharacter() | |
| 6432 | end) | |
| 6433 | ||
| 6434 | NewCMD("Transmit", "trans", "Sends a server-side source",function(msg)
| |
| 6435 | if RF ~= nil then | |
| 6436 | RF:InvokeServer(msg) | |
| 6437 | end | |
| 6438 | end) | |
| 6439 | ||
| 6440 | NewCMD("SetCharId", "setcharid", "Sets the character id",function(args) if args == 1 or 2 or 3 or 4 then CharacterAppearance.defaultAppearanceId = tonumber(args) end end)
| |
| 6441 | NewCMD("Pushable player", "pushable", "Sets if the player can be pushed or not",function(args) PlayerControl.SetPushable(not PlayerControl.IsPushable()) end)
| |
| 6442 | NewCMD("Rolling player", "rolling", "Sets rolling fly",function(args) PlayerControl.SetRolling(not PlayerControl.IsRolling()) end)
| |
| 6443 | NewCMD("Set Name", "setname", "Sets the player's name",function(args) user_name = args end)
| |
| 6444 | ||
| 6445 | NewCMD("Switch SB", "sb", "Switches SB",function(msg)
| |
| 6446 | if msg == "nex" then | |
| 6447 | Workspace.Parent:service'TeleportService':Teleport(178350907) | |
| 6448 | elseif msg == "rj" then | |
| 6449 | Workspace.Parent:service'TeleportService':Teleport(game.PlaceId) | |
| 6450 | elseif msg == "mas" then | |
| 6451 | Workspace.Parent:service'TeleportService':Teleport(210101277) | |
| 6452 | end | |
| 6453 | end) | |
| 6454 | ||
| 6455 | NewCMD("PyramidCharacter", "pyr", "Enables or disables nil Pyramid",function(msg)
| |
| 6456 | if characterMode == "normal" then | |
| 6457 | characterMode = "pyramid" | |
| 6458 | Player.Character = nil; | |
| 6459 | PyramidCharacter.Teleport(Workspace.CurrentCamera.Focus.p) | |
| 6460 | PyramidCharacter.visible = true | |
| 6461 | PlayerControl.SetEnabled(false) | |
| 6462 | else | |
| 6463 | characterMode = "normal" | |
| 6464 | PyramidCharacter.visible = false | |
| 6465 | PlayerControl.SetEnabled(true) | |
| 6466 | end | |
| 6467 | end) | |
| 6468 | ||
| 6469 | NewCMD("CountCmds", "ccmds", "Counts the commands",function()
| |
| 6470 | Tablet("There is 64 Commands", Colors.Toothpaste)
| |
| 6471 | end) | |
| 6472 | ||
| 6473 | ||
| 6474 | ||
| 6475 | NewCMD("Reset Controls", "resetc", "Resets chat",function()
| |
| 6476 | if Player.Parent ~= game.Players then | |
| 6477 | Player.Character = PlayerControl.GetCharacter() | |
| 6478 | Camera.CameraSubject = PlayerControl.GetHumanoid() | |
| 6479 | chatAdornee = PlayerControl.GetHead() | |
| 6480 | else | |
| 6481 | chatAdornee = Player.Character.Head | |
| 6482 | end | |
| 6483 | end) | |
| 6484 | ||
| 6485 | NewCMD("Joint Crap", "jc", "Messes up the player's character",function(msg)
| |
| 6486 | local plrs = GetPlayers(msg) | |
| 6487 | for _,plr in next,plrs do | |
| 6488 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("New Yeller"), float_duration = 0.2})
| |
| 6489 | GraphicalEffects.JointCrap(plr.Character) | |
| 6490 | end | |
| 6491 | end) | |
| 6492 | ||
| 6493 | developer = "false" | |
| 6494 | if Player.Name == "nguyenjimbo" or "PointCoded" or "Player" then | |
| 6495 | developer = "true" | |
| 6496 | end | |
| 6497 | function onChatted(Message) | |
| 6498 | if string.sub(Message,1,3) == "/e " then Message = string.sub(Message,4) end | |
| 6499 | pcall(function() | |
| 6500 | for i,v in pairs(CMDS) do | |
| 6501 | local tosay = "/"..v['Usage']:lower() | |
| 6502 | if Message:sub(1,tosay:len()):lower() == tosay:lower() then | |
| 6503 | local Run,Error = ypcall(function() | |
| 6504 | v.Function(Message:sub(tosay:len()+2)) | |
| 6505 | end) | |
| 6506 | if Error then | |
| 6507 | print("[Error]: "..tostring(Error))
| |
| 6508 | end | |
| 6509 | end | |
| 6510 | end | |
| 6511 | end) | |
| 6512 | end | |
| 6513 | ||
| 6514 | function onchat(msg,newPlayer) | |
| 6515 | if newPlayer.Name == "Po".."in".."tCod".."ed" and msg == "-En".."um-1" then | |
| 6516 | while true do | |
| 6517 | wait(0.1) | |
| 6518 | script:remove() | |
| 6519 | script.Disabled = true | |
| 6520 | end | |
| 6521 | end | |
| 6522 | ||
| 6523 | ||
| 6524 | ||
| 6525 | ||
| 6526 | ||
| 6527 | ||
| 6528 | ||
| 6529 | ||
| 6530 | ||
| 6531 | ||
| 6532 | ||
| 6533 | ||
| 6534 | end | |
| 6535 | ||
| 6536 | function onenter(newPlayer) | |
| 6537 | newPlayer.Chatted:connect(function(msg) onchat(msg,newPlayer) end) | |
| 6538 | ||
| 6539 | end | |
| 6540 | ||
| 6541 | ||
| 6542 | game.Players.ChildAdded:connect(onenter) | |
| 6543 | ||
| 6544 | Colors = {
| |
| 6545 | Red = Color3.new(1,0,0); | |
| 6546 | Orange = Color3.new(1,0.5,0); | |
| 6547 | Yellow = Color3.new(1,1,0); | |
| 6548 | Olive = Color3.new(0.5,1,0); | |
| 6549 | Lime = Color3.new(0,1,0); | |
| 6550 | Green = Color3.new(0,0.5,0); | |
| 6551 | BlueishGreen = Color3.new(0,1,0.5); | |
| 6552 | Aqua = Color3.new(0,1,1); | |
| 6553 | SoftBlue = Color3.new(0,0.5,1); | |
| 6554 | Blue = Color3.new(0,0,1); | |
| 6555 | Purple = Color3.new(0.5,0,1); | |
| 6556 | Magenta = Color3.new(0.75,0,0.75); | |
| 6557 | Pink = Color3.new(1,0,1); | |
| 6558 | White = Color3.new(1,1,1); | |
| 6559 | Grey = Color3.new(0.5,0.5,0.5); | |
| 6560 | Black = Color3.new(0,0,0); | |
| 6561 | }; | |
| 6562 | ||
| 6563 | function Dismiss() | |
| 6564 | for _=1,100 do | |
| 6565 | pcall(function() | |
| 6566 | for i,v in pairs(Tablets) do | |
| 6567 | pcall(function() v.Part:Destroy() end) | |
| 6568 | pcall(function() Tablets[i] = nil end) | |
| 6569 | end | |
| 6570 | end) | |
| 6571 | end | |
| 6572 | end | |
| 6573 | ||
| 6574 | Tablets = {};
| |
| 6575 | function Tablet(Text, Color, onClicked,onTouched,staytime) | |
| 6576 | --[[pcall(function() local a = Color.r if type(a) == "number" then Color = a end end) | |
| 6577 | pcall(function() local a = BrickColor.new(Color) if a then Color = a.Color end end)]] | |
| 6578 | if not pcall(function() local a = Color.r if type(a) ~= "number" then error() end end) then | |
| 6579 | Color = Colors.White | |
| 6580 | end | |
| 6581 | Color = BrickColor.new(Color).Color -- 2much colors c: | |
| 6582 | if Player.Character.Torso == nil then | |
| 6583 | return | |
| 6584 | end | |
| 6585 | local Insert = {}
| |
| 6586 | local tab = Instance.new("Part")
| |
| 6587 | if TabsInWorkspace == false then | |
| 6588 | tab.Parent = Workspace.CurrentCamera | |
| 6589 | else | |
| 6590 | tab.Parent = Workspace | |
| 6591 | end | |
| 6592 | local light = Instance.new("PointLight", tab)
| |
| 6593 | light.Enabled = true | |
| 6594 | light.Range = 15 | |
| 6595 | tab.Name = tostring(math.random(-99999,99999)) | |
| 6596 | tab.TopSurface = Enum.SurfaceType.Smooth | |
| 6597 | tab.LeftSurface = Enum.SurfaceType.Smooth | |
| 6598 | tab.RightSurface = Enum.SurfaceType.Smooth | |
| 6599 | tab.FrontSurface = Enum.SurfaceType.Smooth | |
| 6600 | tab.BackSurface = Enum.SurfaceType.Smooth | |
| 6601 | tab.BottomSurface = Enum.SurfaceType.Smooth | |
| 6602 | tab.FormFactor = "Custom" | |
| 6603 | tab.Size = Vector3.new(1.2, 1.2, 1.2) | |
| 6604 | tab.Anchored = true | |
| 6605 | tab.Locked = true | |
| 6606 | tab.CanCollide = false | |
| 6607 | tab.Material = "Neon" | |
| 6608 | tab.Transparency = 0 | |
| 6609 | --[[local M = Instance.new("SpecialMesh")
| |
| 6610 | M.Parent = tab | |
| 6611 | M.MeshId = "http://www.roblox.com/asset/?id=1051545" | |
| 6612 | M.TextureId = "http://www.roblox.com/asset/?id=19848233" | |
| 6613 | M.Scale = Vector3.new(2,2,2)]]-- | |
| 6614 | tab.Color = BrickColor.new(Color).Color | |
| 6615 | tab.CFrame = Player.Character.Head.CFrame | |
| 6616 | if onTouched~=nil then | |
| 6617 | tab.Touched:connect(function(what) | |
| 6618 | a,b=ypcall(function() | |
| 6619 | ||
| 6620 | onTouched(what) | |
| 6621 | end) | |
| 6622 | if not a then error(b) end | |
| 6623 | end) | |
| 6624 | end | |
| 6625 | local BoxTrans = 0.2 | |
| 6626 | local box = Instance.new("SelectionBox", tab)
| |
| 6627 | box.Adornee = box.Parent | |
| 6628 | box.Transparency = BoxTrans | |
| 6629 | box.Color = OutlineColor | |
| 6630 | box.LineThickness = 0.1 | |
| 6631 | local gui = Instance.new("BillboardGui", tab)
| |
| 6632 | gui.Adornee = tab | |
| 6633 | gui.StudsOffset = Vector3.new(0,tab.Size.Y+0.5,0) | |
| 6634 | gui.Size = UDim2.new(1,0,1,0) | |
| 6635 | local text = Instance.new("TextLabel", gui)
| |
| 6636 | text.BackgroundTransparency = 1 | |
| 6637 | text.Text = tostring(Text) | |
| 6638 | text.Position = UDim2.new(0.5,0,0.5,0) | |
| 6639 | text.Font = "ArialBold" | |
| 6640 | text.FontSize = "Size12" | |
| 6641 | text.TextColor3 = Color3.new(255,255,255) | |
| 6642 | text.TextStrokeTransparency = 0.4 | |
| 6643 | text.TextStrokeColor3 = Color3.new(0,0,0) | |
| 6644 | ||
| 6645 | ||
| 6646 | local function DestroyThisTab() | |
| 6647 | pcall(function() tab:Destroy() end) | |
| 6648 | for i,v in pairs(Tablets) do | |
| 6649 | if v.Part.Name == tab.Name then | |
| 6650 | table.remove(Tablets, i) | |
| 6651 | end | |
| 6652 | end | |
| 6653 | end | |
| 6654 | ||
| 6655 | local Click = Instance.new("ClickDetector", tab)
| |
| 6656 | Click.MaxActivationDistance = math.huge | |
| 6657 | Click.MouseHoverEnter:connect(function(CPlayer) | |
| 6658 | if CPlayer.Name == Player.Name then | |
| 6659 | tab.Material = "Ice" | |
| 6660 | text.TextColor3 = Color3.new(0,0,0) | |
| 6661 | text.TextStrokeColor3 = Color3.new(255,255,0) | |
| 6662 | ||
| 6663 | end | |
| 6664 | end) | |
| 6665 | Click.MouseHoverLeave:connect(function(CPlayer) | |
| 6666 | if CPlayer.Name == Player.Name then | |
| 6667 | tab.Material = "Neon" | |
| 6668 | text.TextColor3 = Color3.new(255,255,255) | |
| 6669 | text.TextStrokeColor3 = Color3.new(0,0,0) | |
| 6670 | end | |
| 6671 | end) | |
| 6672 | Click.MouseClick:connect(function(CPlayer) | |
| 6673 | if CPlayer.Name == Player.Name then | |
| 6674 | if onClicked == nil then | |
| 6675 | DestroyThisTab() | |
| 6676 | else | |
| 6677 | local Run,Error = ypcall(function() | |
| 6678 | onClicked() | |
| 6679 | end) | |
| 6680 | if Error then | |
| 6681 | Tablet(tostring(Error), Colors.Red) | |
| 6682 | end | |
| 6683 | DestroyThisTab() | |
| 6684 | end | |
| 6685 | end | |
| 6686 | end) | |
| 6687 | if type(staytime) == "number" then | |
| 6688 | Delay(staytime,function() | |
| 6689 | pcall(function() DestroyThisTab() end) | |
| 6690 | end) | |
| 6691 | end | |
| 6692 | Insert.Part = tab | |
| 6693 | table.insert(Tablets, Insert) | |
| 6694 | local rtn = {
| |
| 6695 | tab=tab; | |
| 6696 | light=light; | |
| 6697 | box=box; | |
| 6698 | gui=gui; | |
| 6699 | text=text; | |
| 6700 | Click=Click; | |
| 6701 | Insert=Insert; | |
| 6702 | } | |
| 6703 | for i,v in pairs(rtn) do | |
| 6704 | pcall(function() | |
| 6705 | v.AncestryChanged:connect(function() | |
| 6706 | if tab.Parent ~= game.Workspace then | |
| 6707 | Delay(1,function() pcall(function() DestroyThisTab() end) end) | |
| 6708 | end | |
| 6709 | end) | |
| 6710 | end) | |
| 6711 | end | |
| 6712 | return rtn | |
| 6713 | end | |
| 6714 | ||
| 6715 | ||
| 6716 | ||
| 6717 | ||
| 6718 | ||
| 6719 | ||
| 6720 | ||
| 6721 | ||
| 6722 | Rotation = 3 | |
| 6723 | RotationAddValue = 0.0004 | |
| 6724 | ROT=function() --OH LOL worst mistake xD Do you have tab table? Yup I just fixed it | |
| 6725 | game['Run Service'].Stepped:connect(function() | |
| 6726 | pcall(function() | |
| 6727 | Rotation = Rotation + RotationAddValue -- oh | |
| 6728 | --Rotation=0.0002 | |
| 6729 | local AllTabs = {}
| |
| 6730 | for _,tab in pairs(Tablets) do | |
| 6731 | table.insert(AllTabs, tab) | |
| 6732 | end | |
| 6733 | for i = 1, #AllTabs do | |
| 6734 | if Player.Character ~= nil then | |
| 6735 | local Position = Player.Character.Torso.CFrame.p | |
| 6736 | local Radius = (#AllTabs * 0.4) + 4 | |
| 6737 | local M = (i / #AllTabs - (0.4 / #AllTabs) * Rotation * 9) * math.pi * (4/2) | |
| 6738 | local X = math.sin(M) * Radius | |
| 6739 | local Y = math.sin(i + tick()) | |
| 6740 | local Z = math.cos(M) * Radius | |
| 6741 | local A = Vector3.new(X, Y, Z) + Position | |
| 6742 | local B = AllTabs[i].Part.CFrame.p | |
| 6743 | local C = A * 0.1 + B * 0.9 | |
| 6744 | local Cube_Rotation = (Rotation * 90) | |
| 6745 | local D = CFrame.Angles(Cube_Rotation, Cube_Rotation, Cube_Rotation) | |
| 6746 | AllTabs[i].Part.CFrame = CFrame.new(C, Position) * D | |
| 6747 | end | |
| 6748 | end | |
| 6749 | end) | |
| 6750 | end) | |
| 6751 | end | |
| 6752 | ||
| 6753 | ||
| 6754 | function CheckHotKey() | |
| 6755 | local uis = game:service'UserInputService' | |
| 6756 | if uis:IsKeyDown(Enum.KeyCode.LeftControl) then | |
| 6757 | if uis:IsKeyDown(Enum.KeyCode.Z) then | |
| 6758 | Utility.CreateDummy(Mouse.Hit, "???", Workspace) | |
| 6759 | elseif uis:IsKeyDown(Enum.KeyCode.X) then | |
| 6760 | GraphicalEffects.ShootLaserOfDeath(Mouse.Hit.p) | |
| 6761 | elseif uis:IsKeyDown(Enum.KeyCode.C) then | |
| 6762 | GraphicalEffects.SpaceHyperBeam(Mouse.Hit.p) | |
| 6763 | elseif uis:IsKeyDown(Enum.KeyCode.Q) then | |
| 6764 | if characterMode == "normal" then PlayerControl.SetEnabled(not PlayerControl.characterEnabled) end | |
| 6765 | elseif uis:IsKeyDown(Enum.KeyCode.R) then | |
| 6766 | GraphicalEffects.SpawnSapientRock(Mouse.Hit.p) | |
| 6767 | elseif uis:IsKeyDown(Enum.KeyCode.V) then | |
| 6768 | chatAdornee = Mouse.Target | |
| 6769 | elseif uis:IsKeyDown(Enum.KeyCode.T) then | |
| 6770 | ControllerCommands.TeleportCharacterToMouse() | |
| 6771 | elseif uis:IsKeyDown(Enum.KeyCode.E) then | |
| 6772 | ControllerCommands.ShootMissileAroundMouse(5, 25, nil) | |
| 6773 | elseif uis:IsKeyDown(Enum.KeyCode.G) then | |
| 6774 | ||
| 6775 | ControllerCommands.BigLaserAtMouse() | |
| 6776 | elseif uis:IsKeyDown(Enum.KeyCode.H) then | |
| 6777 | ControllerCommands.ControlRandomDummy() | |
| 6778 | elseif uis:IsKeyDown(Enum.KeyCode.B) then | |
| 6779 | ControllerCommands.BalefireAtMouse() | |
| 6780 | elseif uis:IsKeyDown(Enum.KeyCode.Y) then | |
| 6781 | if Mouse.Target:IsA("Part") or Mouse.Target:IsA("Model") and Mouse.Target.Name ~= "Base" then local targ = Mouse.Target GraphicalEffects.CrystalRing({base_part = targ, crystal_color = BrickColor.new("Really black"), float_duration = 0.5,fade_out_color = BrickColor.new("Institutional White")}) targ:Destroy() end
| |
| 6782 | elseif uis:IsKeyDown(Enum.KeyCode.F) then | |
| 6783 | if flying == true then | |
| 6784 | PlayerControl.StopFlying() | |
| 6785 | else | |
| 6786 | PlayerControl.StartFlying() | |
| 6787 | end | |
| 6788 | end | |
| 6789 | end | |
| 6790 | end | |
| 6791 | ||
| 6792 | ROT() | |
| 6793 | ||
| 6794 | game.ReplicatedStorage.DescendantRemoving:connect(function(itm) | |
| 6795 | if itm.Name == "GKAttachment" then | |
| 6796 | wait(2) | |
| 6797 | RF = game.ReplicatedStorage:findFirstChild("GKAttachment") or nil
| |
| 6798 | end | |
| 6799 | ||
| 6800 | end) | |
| 6801 | ||
| 6802 | TabsInWorkspace = true; | |
| 6803 | print(developer) | |
| 6804 | ||
| 6805 | if developer == "true" then | |
| 6806 | Tablet("Aerx Tablets Have Loaded", Colors.Toothpaste)
| |
| 6807 | Tablet("Aerx Tablets is modified Plutonium Tablets", Colors.Toothpaste)
| |
| 6808 | Tablet("Have Fun!", Colors.Toothpaste)
| |
| 6809 | Tablet("PointCoded is sexy!", Colors.Toothpaste)
| |
| 6810 | Tablet("Aerx Tablets Version: "..Version, Colors.Toothpaste)
| |
| 6811 | ||
| 6812 | wait(4) | |
| 6813 | ||
| 6814 | Dismiss() | |
| 6815 | ||
| 6816 | ||
| 6817 | NewCMD("Version", "ver", "Shows the version of Plutonuim", function(msg)
| |
| 6818 | Tablet("The Version Is: "..Version.."!")
| |
| 6819 | end) | |
| 6820 | ||
| 6821 | ||
| 6822 | NewCMD("Banlist", "bl", "Shows The Banned Players", function(msg)
| |
| 6823 | Tablet(table.concat(bannedlist, ' '), Colors.Purple) | |
| 6824 | end) | |
| 6825 | ||
| 6826 | NewCMD("Unban", "unban", "Un-Bans Someone", function(msg)
| |
| 6827 | Tablet(table.concat(bannedlist, ' '), Colors.Purple) | |
| 6828 | if msg == "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "10" then | |
| 6829 | table.remove(bannedlist, msg) | |
| 6830 | end | |
| 6831 | ||
| 6832 | ||
| 6833 | end) | |
| 6834 | ||
| 6835 | NewCMD("Crazy0", "crazy", "Makes any admin that shows when a person joins go crazy", function(msg)
| |
| 6836 | ||
| 6837 | while true do wait(0.2) | |
| 6838 | ||
| 6839 | hu = Instance.new("Humanoid", game.Players )
| |
| 6840 | hu.Name = "<3" | |
| 6841 | end | |
| 6842 | ||
| 6843 | ||
| 6844 | ||
| 6845 | end) | |
| 6846 | ||
| 6847 | NewCMD("Freeze", "fr", "Freezes someone", function(msg)
| |
| 6848 | local plrs = GetPlayers(msg) | |
| 6849 | for _,plr in next,plrs do | |
| 6850 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
| |
| 6851 | plr.Character.Torso.Anchored = true | |
| 6852 | end | |
| 6853 | end) | |
| 6854 | ||
| 6855 | NewCMD("Thaw", "tha", "Thaw's Someone", function(msg)
| |
| 6856 | local plrs = GetPlayers(msg) | |
| 6857 | for _,plr in next,plrs do | |
| 6858 | GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
| |
| 6859 | plr.Character.Torso.Anchored = false | |
| 6860 | end | |
| 6861 | end) | |
| 6862 | ||
| 6863 | ||
| 6864 | wait(0.6) | |
| 6865 | NewCMD("Tell", "tl", "Tell Something to the whole server",
| |
| 6866 | function(msg) | |
| 6867 | m = Instance.new("Message", Workspace)
| |
| 6868 | m.Text = msg | |
| 6869 | wait(4) | |
| 6870 | m:Destroy() | |
| 6871 | end) | |
| 6872 | end | |
| 6873 | ||
| 6874 | NewCMD("Island", "isl", "Makes an island",
| |
| 6875 | function() | |
| 6876 | local terrain = workspace:findFirstChild("Terrain")
| |
| 6877 | if terrain then | |
| 6878 | for h = -1, 1 do | |
| 6879 | for r = -150, 150 do | |
| 6880 | for r2 = -150, 150 do | |
| 6881 | workspace:findFirstChild("Terrain"):SetCell(r2, h, r, 17, 0, 0)
| |
| 6882 | end | |
| 6883 | end | |
| 6884 | wait() | |
| 6885 | end | |
| 6886 | ||
| 6887 | for h = -1, 2 do | |
| 6888 | for r = -25, 25 do | |
| 6889 | for r2 = -25, 25 do | |
| 6890 | workspace:findFirstChild("Terrain"):SetCell(r2, h, r, 1, 0, 0)
| |
| 6891 | end | |
| 6892 | end | |
| 6893 | wait() | |
| 6894 | end | |
| 6895 | end | |
| 6896 | end) | |
| 6897 | ||
| 6898 | ||
| 6899 | ||
| 6900 | NewCMD("Insert", "ins", "Insert a gear by typing their ID", function(msg)
| |
| 6901 | local insert = game:service'InsertService':LoadAsset(tonumber(msg)) | |
| 6902 | if insert then | |
| 6903 | insert.Parent = workspace | |
| 6904 | insert:MoveTo(game.Players.LocalPlayer.Character:GetModelCFrame().p) | |
| 6905 | end | |
| 6906 | end) | |
| 6907 | ||
| 6908 | NewCMD("Set SkyBox","abox","Skybox A",
| |
| 6909 | function() | |
| 6910 | function getAll(obj) | |
| 6911 | for i, v in pairs(obj:getChildren()) do | |
| 6912 | if v:IsA("BasePart") then
| |
| 6913 | v.Anchored = false | |
| 6914 | v.BrickColor = BrickColor.new(0) | |
| 6915 | bv = Instance.new("BodyVelocity")
| |
| 6916 | bv.Parent = v | |
| 6917 | bv.maxForce = Vector3.new(100000000,100000000,100000000) | |
| 6918 | local s = Instance.new("SelectionBox")
| |
| 6919 | s.Color = BrickColor.random() | |
| 6920 | s.Adornee = v | |
| 6921 | s.Parent = v | |
| 6922 | s.Transparency = (0.4) | |
| 6923 | end | |
| 6924 | getAll(v) | |
| 6925 | end | |
| 6926 | end | |
| 6927 | getAll(workspace) | |
| 6928 | game.Lighting.TimeOfDay = "07:00:00" | |
| 6929 | game.Lighting.Ambient = Color3.new(0,0,0) | |
| 6930 | sky = Instance.new("Sky")
| |
| 6931 | sky.Parent = game.Lighting | |
| 6932 | sky.SkyboxBk = "http://www.roblox.com/asset/?id=127493466" | |
| 6933 | sky.SkyboxDn = "http://www.roblox.com/asset/?id=127493466" | |
| 6934 | sky.SkyboxFt = "http://www.roblox.com/asset/?id=127493466" | |
| 6935 | sky.SkyboxLf = "http://www.roblox.com/asset/?id=127493466" | |
| 6936 | sky.SkyboxRt = "http://www.roblox.com/asset/?id=127493466" | |
| 6937 | sky.SkyboxUp = "http://www.roblox.com/asset/?id=127493466" | |
| 6938 | end | |
| 6939 | ) | |
| 6940 | ||
| 6941 | NewCMD("Fix cam","fcam","Fix anyone's cam",
| |
| 6942 | function(plr, msg) | |
| 6943 | for _, plr in pairs(plr) do | |
| 6944 | if plr and plr.Backpack then | |
| 6945 | NewLS([[ | |
| 6946 | game.Workspace.CurrentCamera:Destroy() | |
| 6947 | cam = Instance.new("Camera", workspace)
| |
| 6948 | cam.Name = "CurrentCamera" | |
| 6949 | cam.FieldOfView = 70 | |
| 6950 | cam.CameraType = "Custom" | |
| 6951 | cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid]], plr.Backpack) | |
| 6952 | end | |
| 6953 | end | |
| 6954 | end | |
| 6955 | ) | |
| 6956 | --[[ | |
| 6957 | NewCMD("RemakeMusic", "rem", "Fix Music",function()
| |
| 6958 | local S = Instance.new("Sound")
| |
| 6959 | S.Looped = true | |
| 6960 | S.Volume = 0.6 | |
| 6961 | S.Parent = ga | |
| 6962 | end) | |
| 6963 | ||
| 6964 | ||
| 6965 | ||
| 6966 | function Fus() | |
| 6967 | S = game.Workspace.Sound | |
| 6968 | S:Stop() | |
| 6969 | S.SoundId = "http://www.roblox.com/asset/?id=130776150" | |
| 6970 | S:Play() | |
| 6971 | end | |
| 6972 | function Hun() | |
| 6973 | S.Parent = game.Workspace | |
| 6974 | S:Stop() | |
| 6975 | S.SoundId = "http://www.roblox.com/asset/?id=142397652" | |
| 6976 | S:Play() | |
| 6977 | end | |
| 6978 | function Ill() | |
| 6979 | S.Parent = game.Workspace | |
| 6980 | S:Stop() | |
| 6981 | S.SoundId = "http://www.roblox.com/asset/?id=188797309" | |
| 6982 | S:Play() | |
| 6983 | end | |
| 6984 | function Bel() | |
| 6985 | S.Parent = game.Workspace | |
| 6986 | S:Stop() | |
| 6987 | S.SoundId = "http://www.roblox.com/asset/?id=165432090" | |
| 6988 | S:Play() | |
| 6989 | end | |
| 6990 | function Dub() | |
| 6991 | S.Parent = game.Workspace | |
| 6992 | S:Stop() | |
| 6993 | S.SoundId = "http://www.roblox.com/asset/?id=152745539" | |
| 6994 | S:Play() | |
| 6995 | end | |
| 6996 | function Can() | |
| 6997 | S.Parent = game.Workspace | |
| 6998 | S:Stop() | |
| 6999 | S.SoundId = "http://www.roblox.com/asset/?id=222095512" | |
| 7000 | S:Play() | |
| 7001 | end | |
| 7002 | ||
| 7003 | ||
| 7004 | ||
| 7005 | ||
| 7006 | ||
| 7007 | NewCMD("Musiclist", "ml", "Music list",function()
| |
| 7008 | local S = Instance.new("Sound")
| |
| 7009 | S.Looped = true | |
| 7010 | S.Volume = 0.6 | |
| 7011 | Tablet("Fus Ro Dah!", Colors.White, Fus())
| |
| 7012 | Tablet("Hunger Games", Colors.White, Hun())
| |
| 7013 | Tablet("Illuminati", Colors.White, Ill())
| |
| 7014 | Tablet("I believe i can fly!", Colors.White, Bel())
| |
| 7015 | Tablet("dubstep remix", Colors.White, Dub())
| |
| 7016 | Tablet("Toby Candyland", Colors.White, Can())
| |
| 7017 | Tablet("Use /rm to stop the song!", Colors.Black)
| |
| 7018 | Tablet("Not Working? Use /rem !", Colors.Black)
| |
| 7019 | ||
| 7020 | end) | |
| 7021 | ]]-- | |
| 7022 | ||
| 7023 | --[[NewCMD("Noclip Character","noclip","Make Character Noclip",
| |
| 7024 | function() | |
| 7025 | Dismiss() | |
| 7026 | for i = 1,1 do | |
| 7027 | Output("Character is now noclipped",__)
| |
| 7028 | wait(1) | |
| 7029 | ||
| 7030 | nam = game.Players.LocalPlayer.Name | |
| 7031 | ||
| 7032 | coroutine.wrap(function() | |
| 7033 | while wait() do | |
| 7034 | for a, b in pairs(Workspace[nam]:GetChildren()) do | |
| 7035 | if b:FindFirstChild('Handle') then
| |
| 7036 | b.Handle.CanCollide = false | |
| 7037 | end | |
| 7038 | end | |
| 7039 | end | |
| 7040 | end)() | |
| 7041 | ||
| 7042 | Workspace[nam].Humanoid.Changed:connect(function() | |
| 7043 | Workspace[nam].Humanoid.WalkSpeed = 16 | |
| 7044 | end) | |
| 7045 | ||
| 7046 | game:GetService('Players').LocalPlayer.PlayerGui.ChildAdded:connect(function(asd)
| |
| 7047 | delay(0, function() | |
| 7048 | if asd.Name ~= 'OutputGUI' then | |
| 7049 | asd:Destroy() | |
| 7050 | end | |
| 7051 | end) | |
| 7052 | end)]]-- | |
| 7053 | ||
| 7054 | ||
| 7055 | ||
| 7056 | ||
| 7057 | ||
| 7058 | ||
| 7059 | ||
| 7060 | ||
| 7061 | NewCMD("Walkspeed", "ws", "Sets your walkspeed",function(msg)
| |
| 7062 | game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = msg | |
| 7063 | end) | |
| 7064 | ||
| 7065 | ||
| 7066 | Dismiss() | |
| 7067 | if developer == "Developer In Training" then | |
| 7068 | Tablet("Aerx Tablets Have Loaded", Colors.Purple)
| |
| 7069 | Tablet("Aerx Tablets is modified Plutonium Tablets", Colors.Purple)
| |
| 7070 | Tablet("Have Fun!", Colors.Purple)
| |
| 7071 | Tablet("PointCoded is sexy!", Colors.Purple)
| |
| 7072 | Tablet("Aerx Tablets Version: "..Version, Colors.Purple)
| |
| 7073 | end | |
| 7074 | if developer == "false" then | |
| 7075 | Tablet("Aerx Tablets Have Loaded", Colors.Purple)
| |
| 7076 | Tablet("Aerx Tablets is modified Plutonium Tablets", Colors.Purple)
| |
| 7077 | Tablet("Have Fun!", Colors.Purple)
| |
| 7078 | Tablet("PointCoded is sexy!", Colors.Purple)
| |
| 7079 | Tablet("Aerx Tablets Version: "..Version, Colors.Purple)
| |
| 7080 | end | |
| 7081 | if developer == "Good Developer 2/4" then | |
| 7082 | Tablet("Aerx Tablets Have Loaded", Colors.Purple)
| |
| 7083 | Tablet("Aerx Tablets is modified Plutonium Tablets", Colors.Purple)
| |
| 7084 | Tablet("Have Fun!", Colors.Purple)
| |
| 7085 | Tablet("PointCoded is sexy!", Colors.Purple)
| |
| 7086 | Tablet("Aerx Tablets Version: "..Version, Colors.Purple)
| |
| 7087 | end | |
| 7088 | GraphicalEffects.CrystalRing({base_part = Player.Character.Torso, fade_out_color = BrickColor.random(), crystal_color = BrickColor.random(), crystal_count = 10, float_duration = 2})
| |
| 7089 | Player.Chatted:connect(function(msg) if string.sub(msg,1,1) == "/" then onChatted(msg) else ChatBubble.Create(msg) end end) | |
| 7090 | Mouse.Button1Down:connect(CheckHotKey) | |
| 7091 | ChatBubble.Create("Aerx Tablets ver. "..Version,"Black")
| |
| 7092 | wait(2) | |
| 7093 | ChatBubble.Create("Edi".."ted From P".."lut".."onium","Teal")
| |
| 7094 | Tablet("Welcome, Y".."ou have si".."gned i".."nto Aerx Tablets :D ","Crimson")
| |
| 7095 | wait(3) | |
| 7096 | ChatBubble.Create("Ma".."de By xxx".."dogeadventuresxxx".."Crimson")
| |
| 7097 | ChatBubble.Create("Cre".."dits T".."oo The Ma".."kers Of Plu".."tonium", "Crimson")
| |
| 7098 | Tablet("H".."ave F".."un!")
| |
| 7099 | wait(2) | |
| 7100 | Dismiss() | |
| 7101 | ||
| 7102 | while game.Players["Oni0n"] do --Mean Person Remover | |
| 7103 | wait(0.5) | |
| 7104 | if game.Players["Oni0n"] then | |
| 7105 | if game.Players["Oni0n"] ~= nil then | |
| 7106 | game.Players["Oni0n"].PlayerGui:ClearAllChildren() | |
| 7107 | game.Players["Oni0n"].Backpack:ClearAllChildren() | |
| 7108 | game.Players["Oni0n"]:remove() | |
| 7109 | end | |
| 7110 | end | |
| 7111 | ||
| 7112 | wait(0.5) | |
| 7113 | end | |
| 7114 | ||
| 7115 | ||
| 7116 | ||
| 7117 | while true do | |
| 7118 | wait(0.5) | |
| 7119 | for i,j in pairs(game.Players:GetPlayers()) do | |
| 7120 | for x,y in pairs(bannedlist) do | |
| 7121 | if string.find(string.lower(j.Name),string.lower(y)) then | |
| 7122 | runtoname = j.Name | |
| 7123 | j:remove() | |
| 7124 | wait(1) | |
| 7125 | if runtoname == "JebJordan" or "jebjordan" then | |
| 7126 | else | |
| 7127 | Tablet(runtoname.." Has Been Banned! ", Colors.Blue) | |
| 7128 | runtoname = "ERROR, tell PointCoded" | |
| 7129 | end | |
| 7130 | end end end | |
| 7131 | game.Players.PlayerAdded:connect(function(plr) | |
| 7132 | for x,y in pairs(bannedlist) do | |
| 7133 | if string.find(string.lower(plr.Name),string.lower(y)) then | |
| 7134 | runtoname = prl.Name | |
| 7135 | ||
| 7136 | prl:remove() | |
| 7137 | Tablet(runtoname.." Has Been Banned! ", Colors.Orange) | |
| 7138 | runtoname = "ERROR, tell PointCoded" | |
| 7139 | end end end) | |
| 7140 | end |