#help with scripting
76 messages · Page 1 of 1 (latest)
local part1 = workspace.Part
local part2 = workspace.walls.wall
part1.Touched:Connect(function(hit)
if hit.Parent.Name == part2.Name then
print("hi")
end
end)
thats not the code but its an example(almost the same)
Why cant you send the actual code
What
but this work to
when the block hit something its not printing the hi
It would be hit.Name not hit.Parent.Name
nope still dont printing
Omg stop creating posts with the same issue... @stone salmon
No, you
ah i just blocked him but are you here @nimble kernel ?
Try this
if hit.Parent then
if hit.Parent:FindFirstAncestor(part2.Name) then
print("hi")
end
end
im back
im sending the code
what are you trying to do with the script
to make it that it the part 1 touch\hit part 2 it will print hi
Just do if hit == part2
im new to lua so do i put it like this
** You are now Level 5! **
local part1 = workspace.Part
local part2 = workspace.walls.wall
part1.Touched:Connect(function(hit)
if hit == part2
print("hi")
end
end
end)
if part 1 touches part 2 it prints?
part1.Touched:Connect(function(hit)
if hit == part2 then print("hit") end
end)
its giving an error
show
i fixed it but even now its not working
.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
half of this is chatgpt but its finee
chatgpt 💀
maybe the block movement doing something that dont let it hit the other block
so what do i do
So it wont activate the touched event
you have to do xyz math
Use linearvelocity
Or that
Unanchor the part and make an attachment then set the vectorvelocity to the current direction
Yes
and the fact that players can push it around
omfg again? jeez
what did he said?
they will die on touch
still they can give force
Also what do you want to use the part 1 touched thing for
to move back?
i want it that if the block touch a wall it will reset some things
ok i think i will use your way
