#racing boat game
95 messages · Page 1 of 1 (latest)
ok
gimme a second
im reloading studio
itll be in the titanic model
local titanic = script.Parent
local hitbox = titanic.Hitbox
local icebergs = game.Workspace.Meshes:GetChildren()
hitbox.Touched:Connect(function(part)
if part == icebergs then
titanic.Driveing.Drive:Destroy()
wait(5)
titanic:Destroy()
end
end)
i did the code
is here
bruh it doesnt work ill rewrite the script
gimme a sec
You're comparing a single part to a list
If course that won't work
What you can do ks
if table.find(icebergs, part) then ... end
do i do this script for multiple?
No
ah ty ill try that
Just one
ah shi i planned to have more then 1 iceberg
Oh that's what you mean?
I thought u meant multiple scripgs
Yeah this works for any number of ice bergs
if i had like a part and it had a whole bunch of parts with the same name
if i put that parts name into a script
would it do all of them
No
alr
`if table.find(icebergs, part) then ... end
so i add this instead of local icebergs?
No this is your if statement in your touch function
** You are now Level 3! **
Nope
alr
hitbox.Touched:Connect(function(part)
if table.find(icebergs, part) then
titanic.Driveing.Drive:Destroy()
wait(5)
titanic:Destroy()
end
end)
so this would work
That's correct
alr i will try it
Assuming you still have your variables up top
Nope
Nope keep everythiny
alr i will name them in numbers
it doesnt work
i changed the 5 icebergs names and rammed into them
°^^
ok wait
Why'd u change their names
i thought i had to
Bruh
Names don't matter here
Just leave it
ok
Show me the code tho
i put the script in the model, do i need to put it in hitbox?
'''lua
'''lua local titanic = script.Parent
local hitbox = titanic.Hitbox
local icebergs = game.Workspace.Meshes["Meshes/iceberg - Copy (12)"]
hitbox.Touched:Connect(function(part)
if table.find(icebergs, part) then
titanic.Driveing.Drive:Destroy()
wait(5)
titanic:Destroy()
end
end)
'''
wtf
wait
oh alr ye ok
local icebergs = game.Workspace.Meshes["Meshes/iceberg - Copy (12)"] ik its this line
What happened to Meshes:Get Children()?
Yeah
lemme fix it gimme 1 min
i fixed it
local titanic = script.Parent
local hitbox = titanic.Hitbox
local icebergs = game.Workspace.Meshes:GetChildren()
hitbox.Touched:Connect(function(part)
if table.find(icebergs, part) then
titanic.Driveing.Drive:Destroy()
wait(5)
titanic:Destroy()
end
end)
There you go
and thatll work?
Should work
do i put the script in the hitbox?
Yep
No
Leave it
I was saying yep to it working
@dapper basin