Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local board = Instance.new("Part")
- Part1 = Instance.new("Part")
- SurfaceGui2 = Instance.new("SurfaceGui")
- board.Name = "Board"
- board.Parent = script
- board.CFrame = CFrame.new(37.7500038, 5.49999905, -49.0300102, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- board.Position = Vector3.new(37.7500038, 5.49999905, -49.0300102)
- board.Color = Color3.new(0.972549, 0.972549, 0.972549)
- board.Size = Vector3.new(17, 11, 0.5)
- board.Anchored = true
- board.BottomSurface = Enum.SurfaceType.Smooth
- board.BrickColor = BrickColor.new("Institutional white")
- board.Locked = true
- board.Material = Enum.Material.SmoothPlastic
- board.TopSurface = Enum.SurfaceType.Smooth
- board.brickColor = BrickColor.new("Institutional white")
- Part1.Name = "Score"
- Part1.Parent = script
- Part1.CFrame = CFrame.new(37.7500038, 12.5048256, -49.0300102, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.Position = Vector3.new(37.7500038, 12.5048256, -49.0300102)
- Part1.Color = Color3.new(0.768627, 0.156863, 0.109804)
- Part1.Size = Vector3.new(17, 3, 0.5)
- Part1.Anchored = true
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Bright red")
- Part1.Locked = true
- Part1.Material = Enum.Material.SmoothPlastic
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Bright red")
- SurfaceGui2.Parent = Part1
- SurfaceGui2.LightInfluence = 1
- SurfaceGui2.Face = Enum.NormalId.Back
- SurfaceGui2.ClipsDescendants = true
- SurfaceGui2.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- SurfaceGui2.Adornee = Part1
- score_t = Instance.new("TextBox")
- time_t = Instance.new("TextBox")
- score2_t = Instance.new("TextBox")
- player_t = Instance.new("TextBox")
- score_t.Name = "Score"
- score_t.Parent = SurfaceGui2
- score_t.Position = UDim2.new(0, 0, 0.5, 0)
- score_t.Size = UDim2.new(0.5, 0, 0.5, 0)
- score_t.BackgroundColor = BrickColor.new("Institutional white")
- score_t.BackgroundColor3 = Color3.new(1, 1, 1)
- score_t.BackgroundTransparency = 1
- score_t.Font = Enum.Font.SourceSans
- score_t.FontSize = Enum.FontSize.Size14
- score_t.Text = "Score: "
- score_t.TextColor = BrickColor.new("Institutional white")
- score_t.TextColor3 = Color3.new(1, 1, 1)
- score_t.TextScaled = true
- score_t.TextSize = 14
- score_t.TextStrokeTransparency = 0
- score_t.TextWrap = true
- score_t.TextWrapped = true
- time_t.Name = "Time"
- time_t.Parent = SurfaceGui2
- time_t.Position = UDim2.new(0.5, 0, 0.5, 0)
- time_t.Size = UDim2.new(0.5, 0, 0.5, 0)
- time_t.BackgroundColor = BrickColor.new("Institutional white")
- time_t.BackgroundColor3 = Color3.new(1, 1, 1)
- time_t.BackgroundTransparency = 1
- time_t.Font = Enum.Font.SourceSans
- time_t.FontSize = Enum.FontSize.Size14
- time_t.Text = "Time: "
- time_t.TextColor = BrickColor.new("Institutional white")
- time_t.TextColor3 = Color3.new(1, 1, 1)
- time_t.TextScaled = true
- time_t.TextSize = 14
- time_t.TextStrokeTransparency = 0
- time_t.TextWrap = true
- time_t.TextWrapped = true
- score2_t.Name = "Score2"
- score2_t.Parent = SurfaceGui2
- score2_t.Position = UDim2.new(0.5, 0, 0.3, 0)
- score2_t.Size = UDim2.new(0.5, 0, 0.3, 0)
- score2_t.BackgroundColor = BrickColor.new("Institutional white")
- score2_t.BackgroundColor3 = Color3.new(1, 1, 1)
- score2_t.BackgroundTransparency = 1
- score2_t.Font = Enum.Font.SourceSans
- score2_t.FontSize = Enum.FontSize.Size14
- score2_t.Text = "H/M*T Score: "
- score2_t.TextColor = BrickColor.new("Institutional white")
- score2_t.TextColor3 = Color3.new(1, 1, 1)
- score2_t.TextScaled = true
- score2_t.TextSize = 14
- score2_t.TextStrokeTransparency = 0
- score2_t.TextWrap = true
- score2_t.TextWrapped = true
- player_t.Name = "User"
- player_t.Parent = SurfaceGui2
- player_t.Size = UDim2.new(0.5, 0, 0.3, 0)
- player_t.Position = UDim2.new(0, 0, 0.3, 0)
- player_t.BackgroundColor = BrickColor.new("Institutional white")
- player_t.BackgroundColor3 = Color3.new(1, 1, 1)
- player_t.BackgroundTransparency = 1
- player_t.Font = Enum.Font.SourceSans
- player_t.FontSize = Enum.FontSize.Size14
- player_t.Text = "Player"
- player_t.TextColor = BrickColor.new("Institutional white")
- player_t.TextColor3 = Color3.new(1, 1, 1)
- player_t.TextScaled = true
- player_t.TextSize = 14
- player_t.TextStrokeTransparency = 0
- player_t.TextWrap = true
- player_t.TextWrapped = true
- barrier = Instance.new("Part")
- barrier.Name = "Barrier"
- barrier.Parent = script
- barrier.CFrame = CFrame.new(37.7500038, 7.49999905, -40.0300102, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- barrier.Position = Vector3.new(37.7500038, 7.49999905, -40.0300102)
- barrier.Color = Color3.new(0, 1, 1)
- barrier.Transparency = 0.80000001192093
- barrier.Size = Vector3.new(21, 15, 20.5)
- barrier.Anchored = true
- barrier.BottomSurface = Enum.SurfaceType.Smooth
- barrier.BrickColor = BrickColor.new("Toothpaste")
- barrier.Locked = true
- barrier.Material = Enum.Material.SmoothPlastic
- barrier.TopSurface = Enum.SurfaceType.Smooth
- barrier.brickColor = BrickColor.new("Toothpaste")
- --
- invite = Instance.new("TextBox")
- invite.Name = "invite"
- invite.Parent = SurfaceGui2
- invite.Position = UDim2.new(0, 0, 0, 0)
- invite.Size = UDim2.new(1, 0, 0.3, 0)
- invite.BackgroundColor = BrickColor.new("Institutional white")
- invite.BackgroundColor3 = Color3.new(1, 1, 1)
- invite.BackgroundTransparency = 1
- invite.Font = Enum.Font.SourceSans
- invite.FontSize = Enum.FontSize.Size14
- invite.Text = "Submit scores at: discord.gg/7VB6kAQ"
- invite.TextColor = BrickColor.new("Really red")
- invite.TextColor3 = Color3.fromRGB(42, 255, 231)
- invite.TextScaled = true
- invite.TextSize = 14
- invite.TextStrokeTransparency = 0
- invite.TextWrap = true
- invite.TextWrapped = true
- for i,v in pairs(script:GetChildren()) do
- if v:IsA("BasePart") and v ~= board then
- v.Anchored = false
- local weld = Instance.new("Weld")
- weld.Part0 = board
- weld.Part1 = v
- weld.C0 = board.CFrame:Inverse()
- weld.C1 = v.CFrame:Inverse()
- weld.Parent = v
- end
- end
- local plr = owner
- local char = plr.Character
- if char then else warn("Character not loaded. Re-run the script.") return end
- local root = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Head")
- board.CFrame = CFrame.new(root.Position)*CFrame.new(0,5.5,0)
- local S = 1
- local ding = Instance.new("Sound")
- ding.SoundId = 'rbxassetid://'
- ding.Parent = board
- local count = 0
- local playing = false
- local targets = {}
- local score = {
- hit = 0,
- miss = 0,
- }
- function check_near(p)
- local close = false
- for _,hit in pairs(targets) do
- if hit ~= p and (S*2) >= (p.Position-hit.Position).Magnitude then
- close = true
- end
- end
- return close
- end
- function create_target()
- local _PX,_PY = math.random(1,board.Size.X),math.random(1,board.Size.Y)
- local pos = (board.Position+Vector3.new(-(board.Size.X/2),(board.Size.Y/2),0))-Vector3.new(-(_PX-S/2),(_PY-S/2),0)
- local target = Instance.new("Part")
- target.Position = pos+Vector3.new(0,0,S/2)
- target.Color = Color3.new(0,0,0)
- target.Size = Vector3.new(S,S,S/2)
- target.Anchored = true
- target.Locked = true
- target.Material = Enum.Material.SmoothPlastic
- target.Parent = script
- local c = check_near(target)
- if c or not playing then
- target:Destroy()
- else
- table.insert(targets,1,target)
- end
- end
- function hit_target(p)
- local found = false
- if p then else score.miss = score.miss + 1; score_t.Text = 'Score: ' .. score.hit-score.miss; return; end;
- for i,v in pairs(targets) do
- if v == p then
- found = true;
- table.remove(targets,i);
- end;
- end;
- if found then
- p:Destroy()
- --ding:Play()
- score.hit = score.hit + 1
- else
- score.miss = score.miss + 1
- end
- score_t.Text = 'Score: ' .. score.hit-score.miss
- score2_t.Text = 'H/M*H Score: ' .. (score.hit/score.miss*score.hit)-((score.hit/score.miss*score.hit)%0.001)
- end
- local remote = Instance.new("RemoteEvent")
- remote.Parent = plr['PlayerGui']
- local bval = Instance.new("ObjectValue")
- bval.Name = 'board'
- bval.Value = board
- bval.Parent = remote
- remote.OnServerEvent:Connect(function(lplr,hit)
- if (plr == lplr) and playing then
- hit_target(hit)
- end
- end)
- NLS([[
- local plr = game:GetService("Players").LocalPlayer
- local mouse = plr:GetMouse()
- local camera = workspace.CurrentCamera
- local remote = script.Parent
- local board = remote:WaitForChild("board").Value
- mouse.Button1Down:Connect(function()
- remote:FireServer(mouse.Target)
- end)
- game:GetService("RunService").RenderStepped:Connect(function()
- camera.CameraSubject = board
- camera.CFrame = board.CFrame*CFrame.new(0,0,15)
- end)
- ]],remote)
- function stop()
- spawn(function()
- for i = 10,0,-1 do
- time_t.Text = 'Intermission: ' .. i
- wait(1)
- end
- for i,v in pairs(targets) do if v then v:Destroy(); table.remove(targets,i); end; end;
- score.hit = 0
- score.miss = 0
- start()
- end)
- end
- function setup_time()
- count = 30
- spawn(function()
- while playing do
- if 0 >= count then
- playing = false
- stop()
- return
- end
- count = count - 1
- time_t.Text = 'Time: ' .. count
- wait(1)
- end
- end)
- end
- function setup_targets()
- spawn(function()
- while playing do
- if 5 > #targets and playing then
- create_target()
- end
- wait()
- end
- end)
- end
- function start()
- playing = true
- setup_targets()
- setup_time()
- end
- SurfaceGui2.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
- SurfaceGui2.PixelsPerStud = 50
- player_t.Text = plr.Name
- game:GetService("RunService").Stepped:Connect(function()
- pcall(function()
- for i,v in pairs(plr.Character:GetChildren()) do
- if v:IsA("BasePart") or v:IsA("UnionOperation") or v:IsA("Sound") or v:IsA("Script") or v:IsA("LocalScript") or v:IsA("BillboardGui") then
- v:Destroy()
- end
- end
- end)
- end)
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement