Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I use the MouseButton1Down function in this instance?

Asked by 4 years ago

I'm working on a boss script and I want a gui to pop up saying would you like to join with a decline and accept button. I have the script finished and will list most of it below. Please tell me how I would use it like that.


-- Variables -- local player = game:GetService("Players").LocalPlayer local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerStorage = game:GetService("ServerStorage") local BossArenas = ServerStorage:WaitForChild("BossArenaMaps") local Status = ReplicatedStorage:WaitForChild("BossInformation").Values.Status local Remaining = ReplicatedStorage:WaitForChild("BossInformation").Values.PlayersRemaining local timeleft = ReplicatedStorage:WaitForChild("BossInformation").Values.Time local TimeLength = ReplicatedStorage.BossInformation.Values.Time -- Time for each game local invalid = "Cannot Find SpawnPoints" -- Start -- while true do repeat wait(1) until game.Players.NumPlayers >= 1 -- UI -- --[[local battlejoin = player.PlayerGui.battlejoin battlejoin.Enabled = true battlejoin.backround.accept.MouseButton1Down:Connect(function() end)--]] Status.Value = "Creating Boss.." wait(.5) Status.Value = "Creating Game.." wait(10) local plrs = {} for i, player in pairs(game.Players:GetPlayers()) do if player then table.insert(plrs,player) -- add players into table end end wait(3) local Arenas = BossArenas:GetChildren() local ArenaChosen = Arenas[math.random(1,#Arenas)] Status.Value = ArenaChosen.Name.." has appeared" local CloneArena = ArenaChosen:Clone() CloneArena.Parent = workspace local battlegui = player.PlayerGui.inbattle battlegui.Enabled = true -- Teleporting Players -- local SpawnPoints = CloneArena:FindFirstChild("SpawnPoints") if not SpawnPoints then print(invalid) end local SpawnPointsAvailable = SpawnPoints:GetChildren() for i, player in pairs(plrs) do if player then character = player.Character if character then -- If theres a character teleport them to arena character:FindFirstChild("HumanoidRootPart").CFrame = SpawnPointsAvailable[1].CFrame table.remove(SpawnPointsAvailable,1) local GameTag = Instance.new("BoolValue") GameTag.Name = "GameTag" GameTag.Parent = player.Character else -- If there is not a character remove them from table if not player then table.remove(plrs,i) end end end end Status.Value("Game Starting...") wait(2) for i = TimeLength,0,-1 do for x, player in pairs(plrs) do if player then character = player.Character if not character then -- the player left the game else if character:FindFirstChild("GameTag") then -- the player is still here print(player.Name.." is still in game") else -- player left game table.remove(plrs.x) print(player.Name.." is removed.") end end else table.remove(plrs,x) print(player.Name.." is removed.") end end timeleft.Value = "Time Left: "..i Remaining.Value = "Players Remaining "..#plrs if #plrs == 1 then -- Plrs Status.Value = "this person is coool" elseif #plrs == 0 then Status.Value = "nobody is alive" elseif i == 0 then timeleft.Value = "TIME IS OUT!!" break end wait(1) end print("game ended") for i, player in pairs(game.Players:GetPlayers()) do character = player.Character if not character then -- ignore em else if character:FindFirstChild("GameTag") then character.GameTag:Destroy() end if player.PlayerGui:FindFirstChild("inbattle") then player.PlayerGui.inbattle.Enabled = false end end player:LoadCharacter() end CloneArena:Destroy() -- game end end

THIS IS A NORMAL SCRIPT!

0
please don't repost your question, be patient DeceptiveCaster 3761 — 4y
0
ok :( XxWingKing 96 — 4y

Answer this question