#.touched not working

49 messages · Page 1 of 1 (latest)

woeful scroll
#

im making a space game where you can build buildings on different planets. in order to differentiate some planets im making different tiers of atmospheres (sphere parts) that they can have to make each building work differently. whenever you build a buildign it clones itself from replicated storage and a touched function runs detecting if you are touching a certain type of atmosphere based on the name of the atmosphere (part) you are touching. however, no matter what i do the touched function doesnt run the if statements trying to get the name of the atmosphere (part) you're touching. ive done multiple print tests and tried just checking what the part touches and when i did that it just said that it's touching the players body parts. so i do not know what to do

torn crowBOT
#

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

distant bay
#

also instead of doing

part.Transparency = 0.25
task.wait(x)
part.Transparency = 0.5
....
just do:

while wait(x) do
part.Transparency += 0.25
end)

its much more readable and easier to edit

#

@woeful scroll

woeful scroll
distant bay
#

did you figure out what the problem is?

woeful scroll
#

no

#

another guy i asked said it looked fine

distant bay
#

and it still doesnt work?

woeful scroll
#

yea

distant bay
#

is the touching part have any sort of clothing or space suit on etc?

woeful scroll
#

nah

#

just the atmosphere part

distant bay
#

huh

#

idk, I'd be able to help more if I had it infront of me

#

sorry dude

woeful scroll
#

its alr

weary plume
#

Can i try

#

?

#

But i m on the phone

#

Make sure you have the atmosfere on cancollide turned on and anchor on

#

And the problem is at line 46 to 55

weary plume
#

Change line 47 to if hit and hit:IsA("Part") and hit.Name:match("atmosfere") then

woeful scroll
#

alr ill try that

weary plume
#

Wait im not done

#

Let me cooj

#

Cook

woeful scroll
#

bet

weary plume
#

After line 47 add another 2 lines and say if not rg then
rg = true

#

At line 50 if hit.Name == "atmosphere1" then

#

Add one line and say rockclone()
After the line say elseif hit.Name == "atmosphere2" then
rockclone2()

#

end

#

task.wait(1) for a lil delay

#

rg = false

#

@woeful scroll

woeful scroll
#

alr

#

ill try in a bit im in rthe middle of a game

weary plume
#

Okk

#

I ve tried my best, it's hard on the phone

woeful scroll
#

yea

#

thanks!!!

weary plume
#

Its working?

woeful scroll
#

i havent tried it yet i was just thanking u for trying helping

weary plume
#

Okk

#

Np

#

My pleasure

weary plume
#

So