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

How do I create Thermal Vision?

Asked by 4 years ago

I am trying to create some sort of thermal goggles for my game, when equipped, would highlight any player/humanoid within a 30 stud distance. I also wanted to connect it to a GUI button, when clicked, would activate the thermal vision, and when the "Off" GUI button is clicked, to deactivate the thermal vision. I am pretty stumped on how this operates as I tried multiple times on making it. Unfortunately, I have deleted the scripts I made so I cannot paste them here to be evaluated, but it would be much appreciated if somebody can explain to me how to make it.

1 answer

Log in to vote
0
Answered by
mc3334 649 Moderation Voter
4 years ago

So im not going to write your whole code for you, but here is the idea. When the button is activated, check every second what objects are in a 30 stud radius with region3s. (it will end up being a 32 stud radius becasue regeon3s go by 4 studs). Then if one of the objects is a humanoid, do:

local selectionBox = Instance.new("SelectionBox")
selectionBox.Adornee = HumanoidRootPart
selectionBox.Color3 = Color3.new(1,0,0)
selectionBox.Parent = HumanoidRootPart
game:GetService("DebrisService"):AddItem(selectionBox,1)

I hope this helps, and remember to make the selection boxes locally so only one player can see them, not the whole server. ~mc3334

Ad

Answer this question