#my script aint WORKING bro and idk why

1 messages · Page 1 of 1 (latest)

lament prism
#

NO errors at ALL when i click the rock that this script is in and i have no clue why bro

local Players = game:GetService("Players")
local BadgeService = game:GetService("BadgeService")
local HttpService = game:GetService("HttpService")
local TeleportService = game:GetService("TeleportService")

local Popup = require(game.ServerScriptService.popup)

local part = script.Parent

local clickDetector = Instance.new("ClickDetector")
clickDetector.Parent = part

local debounce = false

local badgeid = 4003075391905682
local placeid = 10146059518
local webhookurl = "iamnotshowingyouguysmywebhookurl"

local function sendWebhook(player)
    local data = {
        content = string.format(
            "%s (@%s) has found another way [#79] ***[DIFFICULTY: 997]*** (https://www.roblox.com/badges/%d)",
            player.DisplayName,
            player.Name,
            badgeid
        )
    }

    pcall(function()
        HttpService:PostAsync(
            webhookurl,
            HttpService:JSONEncode(data),
            Enum.HttpContentType.ApplicationJson
        )
    end)
end

clickDetector.MouseClick:Connect(function(player)
    if debounce then return end
    debounce = true

    local playerGui = player:FindFirstChild("PlayerGui")

    if playerGui and playerGui:FindFirstChild("rockui") then
        playerGui.rockui.TextLabel.Visible = true
    end

    task.wait(3)

    for _, v in pairs(workspace:GetChildren()) do
        v:Destroy()
    end

    if game.SoundService:FindFirstChild("noise") then
        game.SoundService.noise:Play()
    end

    task.wait(3)

    local hasBadge = false

    pcall(function()
        hasBadge = BadgeService:UserHasBadgeAsync(player.UserId, badgeid)
    end)

    if not hasBadge then
        pcall(function()
            BadgeService:AwardBadgeAsync(player.UserId, badgeid)
        end)

        sendWebhook(player)
        Popup.Show("Secret 54", player)
    end

    task.wait(3)

    TeleportService:Teleport(placeid, player)
end)
rugged void
#

not sure what was the problem
have you tried debugging functions with prints

hexed fox
#

Sorry i cant code either

winged solar
#

Do you intend to destroy everything in Workspace

smoky kestrel
#

couldve done workspace:ClearAllChildren() but yeah

winged solar
#

Which part is not working, you say not at all, Can you describe more clearly. Is anything working ? Is just some of it failing or only some of it ?

vagrant hullBOT
#

studio** You are now Level 4! **studio

winged solar
#

Are you getting any errors in the output window , in red ?

winged solar
#

Well your going to destroy the Player Character if you try to destroy everything in Workspace. A better way to write that would be : for i, v in pairs(workspace:GetChildren()) do
if not v:IsA("Terrain") and not v:IsA("Camera") and not Players:GetPlayerFromCharacter(v) then
v:Destroy()
end
end

#

You can always put a folder into Replicated Storage, name it something like Holding. Instead of destroying the children of workspace, move it to the Holding folder temporarily ? Then bring it all back to workspace when you are ready.

#

Also your TextLabel, is it in a SurfaceGui that you've named rockui ? Is the rockui inside of StarterGui and then adorned to the rock ? the rock is in Workspace right ?