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
#.touched not working
49 messages · Page 1 of 1 (latest)
** You are now Level 4! **
use print statements to figure out if its the touch statement or the if
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
its the if statement
did you figure out what the problem is?
and it still doesnt work?
yea
is the touching part have any sort of clothing or space suit on etc?
its alr
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
Line 45 add local rg = false, its rockgenerating
Change line 47 to if hit and hit:IsA("Part") and hit.Name:match("atmosfere") then
alr ill try that
bet
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
Its working?
i havent tried it yet i was just thanking u for trying helping
So