Still have questions? Join our Discord server and get real time help.
0

How to make a brick that unanchors everything it touches?

Ok, in ROBLOX I'm trying to create a disaster game and I have a tornado. The tornado moves in random directions and I want it to unanchor any parts it comes in contact with. I have some models spread around (houses, stores, and other stuff) and I want it to unanchor the parts inside the models it comes in contact with.

I've tried numerous scripts online, but they are either outdated or simply don't work. So, how would I go about doing this?

(By the way for those wondering, this isn't a request to script the entire thing, I would just like to know the functions and code structure required since I'm a beginner to Lua.)

1
Touched event -> if not baseplate -> Anchored = false. Rheines 582 — 2mo

0
Miniller 331
2 months ago

Example:

--In my case, 'Tornado' is a part at Workspace.
if part.Name ~= "Baseplate" then -- If part is not baseplate (keep this!)
part.Anchored = false
end
end)


This should unanchor every part it touches expect if the touched part is the Baseplate.

Sorry if I used something that can be done easier.

Hope this helps!

1
With a bit of tweaking this works. Thanks! iPixelDev 3 — 2mo
0
2 months ago

You'd have to make a Touched event for the tornado. When the tornado is touched, it checks what touched it, and if it's not a player then it sets the anchored property of the part to false

Tornado.Touched:Connect(function(Part)
if not game.Players:GetPlayerFromCharacter(Part.Parent) then
--Unanchor the part
end
end)

0
Ok thank you, I'll try this. iPixelDev 3 — 2mo
0
blockmask, I didn't found any part of a player's character what was anchored.. Miniller 331 — 2mo
0
And also, an important thing: You didn't added what I did, testing if the part is the baseplate. Now, if he uses your script, and tornado touches Baseplate, it will fall down.. Miniller 331 — 2mo
0
Who makes a game on a baseplate? blockmask 351 — 2mo