#i dont know why but when i did the script right (by a youtube video) it doesnt work

1 messages · Page 1 of 1 (latest)

tiny mountain
#

while i used it on many things can anyone tell me the problem (i still dont have the badge)

#

local GameId = "7299550346"

function Touched(Player)
local FromChar = game.Players:GetPlayerFromCharacter(Player.Parent)
if FromChar then
local TeleService = game:GetService("TeleportService")
TeleService:Teleport(GameId,FromChar)
end
end
script.Parent.Touched:Connect(Touched)

#

local badgeID = 4127270935249505
local badgeService = game:GetService("BadgeService")

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
badgeService:AwardBadge(plr.UserId, badgeID)
end
end)

#

the first script is the when touched it teleports to a subplace

#

the second script is when touched you get a badge

cinder flower
#

idk but i think it might be that GameId is a string

#

try changing it from local GameId = "7299550346" to local GameId = 7299550346

dull marten
cinder flower
cinder flower
#

was there an error in the console?

#

i kow what badges are but were there any errors

dull marten
#

If that was error describe it say in studio output

cinder flower
#

??

#

was there an error in studio output

#

after trying to do what u were doing and it didnt work

dull marten
cinder flower
#

like any error

#

at all

#

that has to do with tele service or badges

dull marten
#

The script line bit off

#

Since they begin to scripting

cinder flower
#

take a picture of your studio output after clicking play and doing what triggers the script

#

im not sure wym

dull marten
cinder flower
#

they js started scripting?

dull marten
#

Sound like it

cinder flower
#

OH WAIT

#

the problem is u dont have the badge, right??

dull marten
#

Inportant crates a badge

#

He not online tho?

cinder flower
#

wait did u follow a yt tutorial or did someone make the script for u?

#

but either way i think the reason you dont have the badge is that your game isnt published

dull marten
#

The title say it all

cinder flower
#

ur game has to be published to get badges

dull marten
#

Fr see in game

cinder flower
#

okay well i think this will be solved if u publish ur game to roblox?

dull marten
#

@tiny mountain

cinder flower
#

can u link tutorial u used?

dull marten
#

I meant seen received badge in game

dull marten
cinder flower
#

wait so briefly explain the problem ur having

cinder flower
tiny mountain
#

Im sorry I was sleeping

#

I'll send link right now

tiny mountain
#

In todays video I show you how to make a player receive a badge when a part is touched!
Hope you enjoyed the video, Have a lovely rest of your day!
If you are a bit confused what to do, Feel free to message me on Discord and Ill help you out!

Script:

local badgeID = 1234567890 -- Change this ID YOUR badge ID
local badgeService = game:GetServic...

▶ Play video
#

i copy and pasted the script

#

and added to an uncollidable part

#

that can query and touch

#

so i basically added the two scripts into the uncollidable part

#

so it could teleport people and give a badge aswell

cinder flower
#

did u change the game id, the badge id, and did u publish the game @tiny mountain

tiny mountain
#

and game

cinder flower
#

if its the same badge and game id as the video, then u have found the problem

#

you have to change the badge id to a badge of ur choice that u own

#

and you have to change the game id to the place id of the game you want to teleport to

tiny mountain
cinder flower
#

is the game published tho?

#

I found issues now -- 1: the GameId needs to be a number, not a string. Second of all, you should award the badge in the Touched function, but before the player gets teleported

#

also you have to be in actual roblox

#

to get the badge

tiny mountain
#

@cinder flower everything is good but it still doesn't give a badge

cinder flower
#

are u sure its a number and not a string

#

number - 901829381
string - "901829381"

dull marten
dull marten
#

local badgeID = 4127270935249505 only line correct rest of it is wrongs

#

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

Players.PlayerAdded:Connect(function(player)
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, BADGE_ID)
end)

if success and not hasBadge then
    pcall(function()
        BadgeService:AwardBadge(player.UserId, BADGE_ID)
    end)
end

end) in ServerScriptService

tiny mountain
#

@dull marten

#

@cinder flower

tiny mountain
#

so it should be a string

dull marten
#

just use digit numbers @tiny mountain

tiny mountain
#

then how

#

I use the same script in the video

#

it still doesn't work

dull marten
# tiny mountain it still doesn't work

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

local BADGE_ID = 2152968894 -- your badge ID

Players.PlayerAdded:Connect(function(player)
-- Run in a safe protected call
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, BADGE_ID)
end)

if success then
    if not hasBadge then
        -- Award the badge safely
        pcall(function()
            BadgeService:AwardBadge(player.UserId, BADGE_ID)
            print("Badge awarded to " .. player.Name)
        end)
    else
        print(player.Name .. " already has the badge")
    end
else
    warn("Failed to check badge for " .. player.Name)
end

end)

#

just replace with your badge id

tiny mountain
#

wait but look

#

At the video it says that the badge service:award badge has a orange line

dull marten
#

that are different types of badges with their own objectives

#

only get it 1 times

tiny mountain
#

@dull marten

#

dude