Check out my AFK Script!

https://gyazo.com/f718c9f8ae0ce879ca4b4992006b9530

I was hoping to create a thing where your avatar/username goes invisible when you say “afk” if anyone knows how? Can you please inform me, thank you, I would really appreciate it!

9 Likes

Wow I love it! I wish to know how to do it. Amazing work dude! :star_struck:

1 Like

Tutorials on YouTube can assist you, trust me, they’re quite helpful if you ask me.

2 Likes

You would first have to find the character model. Then you would search for every part inside of it.

local Character = --This would be whatever method you would use to obtain the character model.

for _, v in pairs(Character:GetChildren()) do
   if v:IsA("Part") then
      v.Transparency = 1
   end
end
Character:FindFirstChildOfClass("Humanoid").NameDisplayDistance = 0
Character:FindFirstChildOfClass("Humanoid").HealthDisplayDistance= 0

Then, if you wanted to reset it back, you would run this:

local Character = --This would be whatever method you would use to obtain the character model.

for _, v in pairs(Character:GetChildren()) do
   if v:IsA("Part") then
      v.Transparency = 0
   end
end
Character:FindFirstChildOfClass("Humanoid").NameDisplayDistance = 100
Character:FindFirstChildOfClass("Humanoid").HealthDisplayDistance= 100
4 Likes

Ayt. Thank you! Have a great day!

1 Like

Great! Thank you for the information!

Would I put those into the script as there own script or make a new script?

2 Likes

It wouldn’t matter, it just needs to know what the character model is.

1 Like

You as well, thank you once again for the positive feedback!

3 Likes

This keeps showing with a red underline, do you know why? Screenshot by Lightshot

1 Like

After seeing this post, i made an AFK Pack on studio. How It works: When u say afk it will teleport u to a brick on workspace named afkpeopleresthere
if u say “not afk” it will teleport u to the original location u were in 1 second before u said afk
in order for it to work u must put a part on workspace named “afkpeopleresthere”

2 Likes

It would be from something previous in the code.

1 Like

What you can do is this. Also, check out the API Reference for roblox for force fields. ForceField | Documentation - Roblox Creator Hub. Once you understand it, you can do it fairly easily.

game.Players.PlayerAdded:Connect(function(plr)
  plr.Chatted:Connect(function(msg)
   if msg == "afk" then
     --Do stuff.
   end
  end)
end)

Still a really cool feature.

1 Like

Looks pretty good at the moment. Hopefully you figure out the invisibility!

1 Like

I believe I’ve figured it out.

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		if msg == "afk" then
			local FindPlayer = game.Workspace:FindFirstChild(plr.Name):waitForChild("Humanoid")
			if FindPlayer ~= nil then
				FindPlayer.DisplayName = "‏‏‎ ‎‎‎‎‎‎"
			end
		end
	end)
end)

I used an invisible character from this website. I’ve tested it and it should work. Hope you enjoy.

2 Likes

I could say that’s just a simple FF activated by chat command. But still good job!

1 Like