I'm bad with coding. yep, but when i code games its usually code from the internet, but i cannot find any code that makes a part dissapear 2 seconds after looking at it, tryna make a horror game here guys! any code that works would be appreciated! also would it work with humanoids?
1 | print ( "sub2_creeper_pro12" ) |
2 |
3 | local function = function .new = 5 |
4 | if 5 = nil then |
5 | do |
6 | end ) |
7 | end ) |
8 | end |
Let me give you an idea of what to do:
01 | local Player = game:GetService( "Players" ).LocalPlayer |
02 | local Mouse = Player:GetMouse() |
03 | local Rep = game:GetService( "ReplicatedStorage" ) |
04 |
05 | local Part = workspace.Part -- the part we are looking for |
06 |
07 | Mouse.Move:Connect( function () |
08 | if Mouse.Target = = workspace [ Part ] then -- if the mouse's target is the part in the workspace |
09 | local event = Rep.Event -- the event you are firing |
10 |
11 | event:FireServer() |
12 | end |
13 | end ) |
Now the OnServerEvent is up to you to figure out.
look on the internet how to detect a player looking at something. then just wait 2 seconds and make it disappear.