#can someone help me with my broken flashlight that i made just now

1 messages · Page 1 of 1 (latest)

vernal sinew
#

so i have the model and script and it even shows in my inventory (yk like the 1,2,3 one at the bottom of screen) and when i equip it, nothing shows. i want it to also be able so i can see it in first person on the left side if the screen and not show in the inv but instead already be on the left hand turned on, thanks everyone who helps🙏

late current
vernal sinew
late current
#

you're supposed to do .Equipped not .Activated

The difference:

.Equipped: method to check if a tool is equipped

.Activated: method to check if a tool is equipped with mouse being held down on the screen

vernal sinew
#

so do i change it to .equipped

late current
#

yea

#

tell me if it works

vernal sinew
#

uh

#

no

late current
#

and also where is your tool located

#

first

vernal sinew
#

in starter pack

frail field
late current
#

true

#

i was thinking that

vernal sinew
late current
#

but I was trying to confirm that

vernal sinew
#

would that change anything?

late current
#

@frail field gave a better explanation

frail field
vernal sinew
#

alr

#

thx

late current
#

yea try script instead of localscript

vernal sinew
#

okk

late current
#

see if it works

frail field
#

Yea ngl you could probably just copy and paste that code into a server script and it would work

late current
#

yea

#

👍 or 👎

vernal sinew
vernal sinew
frail field
#

Nope just put a normal script inside the same place you had the local one

robust oreBOT
#

studio** You are now Level 1! **studio

frail field
#

And just copy and paste the code into it

vernal sinew
#

anddd

#

no

#

unfortuallny still the same

late current
#

try adding print("Equipped") and see if it works

robust oreBOT
#

studio** You are now Level 1! **studio

late current
#

if that works then we can continue

vernal sinew
frail field
#

Once you activate it in the workspace, click on the flashlight in the explorer and see if it says its enabled, it may be an issue with the light itself, also the print statement ryan said

late current
#

after the .Equipped event

vernal sinew
#

ok

late current
#

script.Parent.Equipped:Connect(function()
print("Equipped")

vernal sinew
#

ok

#

mines at function(s)

late current
#

ik

#

just do it right after that

vernal sinew
#

o

late current
#

tellme if it prints that

vernal sinew
#

ok sory

#

ar

#

alr

late current
#

if it does then were ontrack

frail field
#
script.Parent.Equipped:Connect(function()
print("equipped")
end) ``` something like that
late current
#

did it print equipped?

vernal sinew
#

hm instead i got a weird red text

robust oreBOT
#

studio** You are now Level 4! **studio

frail field
#

Post a pic of it here

vernal sinew
late current
#

show us the script

vernal sinew
late current
#

you put an extra ")"

vernal sinew
#

mighhtve done sum dumb im very stupid when it comes to scripting :/

#

where

late current
#

🤣

#

at the end

vernal sinew
#

bru

late current
#

at the part after printing

vernal sinew
#

oh

late current
#

not the actual end of ur code

#

lol

vernal sinew
#

o ok

#

hm stil getting the red text

late current
#

show me the code

vernal sinew
frail field
#
script.Parent.Equipped:Connect(function()
print("equipped")
end)

script.Parent.Activated:Connect(function()
  if script.Parent.Handle.SurfaceLight.Enabled == true then
    script.Parent.Handle.SurfaceLight.Enabled = false
  else
    script.Parent.Handle.SurfaceLight.Enabled = true
  end
end) ```  do this
vernal sinew
#

alr

frail field
# vernal sinew

You have an extra end statement in the function so its trying to close 3 functions when you opened 2

vernal sinew
#

replace the old one?

frail field
#

Yep replace all of the old code with that one

vernal sinew
#

ok

late current
#

I just rewrote your code in studio

#

I can give it

vernal sinew
#

sure

#

no red text

#

bit still nothing

late current
#

script.Parent.Equipped:Connect(function() print("Equipped") if script.Parent.Handle.SurfaceLight.Enabled == true then script.Parent.Handle.SurfaceLight.Enabled = false else script.Parent.Handle.SurfaceLight.Enabled = true end end)

late current
#

👌

robust oreBOT
#

studio** You are now Level 2! **studio

vernal sinew
late current
#

just try it

vernal sinew
#

ok

#

nope on a rope

#

still nothing

#

which sucks

frail field
#

Check the explorer after you activate it while still playing

#

Check if the enabled property is true in the light object it may be the light thats the problem

late current
frail field
#

Yep click the surfacelight

vernal sinew
frail field
#

Then check the properties of it

vernal sinew
frail field
#

While your still playing it

#

Is enabled true?

vernal sinew
#

yea

frail field
#

Yep its the light

#

Can you take a pic of what the light properties look like

vernal sinew
#

wait

#

yea i gotchu

frail field
#

Yep its on its just not showing

vernal sinew
#

i might have to go soon too :/

vernal sinew
frail field
# vernal sinew

When you click the light property does it show that the range of the light is going in a forward direction?

late current
#

maybe try pointer light

frail field
#

it says its facing right

late current
#

try try pointlight and find a good angle

#

surface light is like for glowing parts

vernal sinew
late current
#

for flashlight you should do pointlight

vernal sinew
#

yeah no it still imaint budgin

vernal sinew
late current
#

and also put it in workspace and see if it looks good

vernal sinew
#

like this?

#

also should i change anything in the script to pointlight

frail field
#

Yep that should work just put it in the starterpack then test it again, make sure to change the name in the script from surfacelight to pointlight

robust oreBOT
#

studio** You are now Level 2! **studio

late current
vernal sinew
#

like this

frail field
frail field
vernal sinew
#

and nothing

#

i might have to redo everything tmr

#

cuz imma go to bed

#

lowkey tired

#

if yall can maybe help tmr that would be sick

late current
#

for me, 3

vernal sinew
#

for me maybe 1 week lol

#

i suck so bad

late current
vernal sinew
#

i rly needa learn

vernal sinew
late current
#

can you add me so we can get in contact later

vernal sinew
#

u too davon?

frail field
#

Yessir

vernal sinew
vernal sinew
#

again thank u guys for tryna fix my stupid flashlight lol

robust oreBOT
#

studio** You are now Level 5! **studio