XJurrasicX
(jurrasic)
February 26, 2023, 7:28pm
#1
Trying to make a lamp, where you hold down E the light will turn on, wait 5 seconds, then turn off, and the proximity prompt can no longer be activated
(I turned brightness up to 40 to test)
script.Parent.ProximityPrompt.Triggered:Connect(function()
script.Parent.Light.SurfaceLight.Brightness = 40
wait(5)
script.Parent.Light.SurfaceLight.Brightness = 0
script.Parent.Plane.ProximityPrompt:Destroy()
script.Parent.Light.SurfaceLight:Destroy()
end)
Jacky2804
(Jacky2804)
February 26, 2023, 7:36pm
#2
So the problem is that you can not reactivate your proximity prompt again? That is because you are deleting it from this line.
script.parent.plane.proximityprompt:Destroy()
XJurrasicX
(jurrasic)
February 26, 2023, 7:38pm
#3
no, I want it to not be able to be reactivated, but the issue i’m having is the brightness is not working.
Probably should have been more clear, sorry.
hbgnhu
(CrimKing)
February 26, 2023, 8:08pm
#4
I’m not sure about the surface light, we may need more info but for the prompt at the beginning you are using different prompts
script.Parent.ProximityPrompt
--vs
script.Parent.Plane.ProximityPrompt
That may be causing an issue
1 Like
O3_O2
(o3_o2)
February 26, 2023, 8:17pm
#5
Okay I’m not exactly sure how your objects are set up but, try using SurfaceLight.Enabled
instead of SurfaceLight.Brightness
If you don’t want it to be activated again, you can change the MaxActivationDistance to 0 in the Proximity Prompt with the script.
script.Parent.ProximityPrompt.Triggered:Connect(function()
script.Parent.Light.SurfaceLight.Brightness = 40
wait(5)
script.Parent.Light.SurfaceLight.Brightness = 0
script.Parent.ProximityPrompt.MaxActivationDistance = 0
end)