#I don't know why but when I restart or change characters this script stops working
72 messages · Page 1 of 1 (latest)
in the screengui the textbutton is in there should be something in the properties tab called reset on spawn or something like that
try toggling that off
@hoary moon
** You are now Level 1! **
can you check my post
Thanks but it still doesn't work 😦
print player
fella player wont be nil
But what if it ios
how
print(plr)
it ISNT
But what if it is
try turning off resetonspawn in the screenguis properties
it isnt
put the player in the while wait loop
** You are now Level 16! **
so it cant be nil
It will
no
Do you know?
in my 5 years of scripting never once has localplayer been nil
But no GetService
for game.players yes
never used it once for players
its not a good practice if unnecessary
game.players works just as well
and is shorter
and easier
0k
it still doesn't work xd
does anything remove the script or disable it?
he said it stops working after he restarts or changes characters
so not the case
Yes, because everything works correctly but when you restart the character it no longer works
I have already tried to redo the script several times but nothing, could any of you help me do something similar?
Is it solved ?
No
Don't use while wait
Use
local Run = game:GetService("RunService")
local Badge = game:GetService("BadgeService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local BADGE_ID = 2153409903
local function CheckBadge()
script.Parent.Visible = Badge:UserHasBadgeAsync(player.UserId, BADGE_ID)
end
Run.HeartBeat:Connect(CheckBadge)
Tysm , I'll try it when I get back
it still doesn't work. :(((
** You are now Level 2! **
where is the textbutton parented to
my rough assumption if that what if u put the localplayer in the heartbeat instead, so u can like check for the character since it changes
(if its in the player, when u change or restart the character u might reset whats inside the player aswell? So it ends up removing the textbutton also)
i do kno dud
I dont know exactly what your problem is and what you are trying to make and what u did so i cant give a logical solution?
hope it helps
its 2am rn and im just trying to sleep
I didn't understand anything but thanks for trying to help