You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to fix my tsunami thingy
- What is the issue? Include screenshots / videos if possible!
Script applies velocity to a single part that is anchored and locked when it shouldn’t, other parts are just fine
- What solutions have you tried so far? Did you look for solutions on the Creator Hub?
I removed elseif statement and it worked but thats not what i want
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
script.Parent.Touched:Connect(function(hit)
if (hit.Locked == false and hit.Anchored == false) and not (hit.Parent:FindFirstChildOfClass("Humanoid") or hit.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
hit:BreakJoints()
hit:ApplyImpulse(Vector3.new(-200,10,math.random(-250,250)))
elseif hit.Anchored == false and hit.Parent:FindFirstChildOfClass("Humanoid") then --Keeps applying velocity to the same part that is anchored
hit.Parent:FindFirstChildOfClass("Humanoid").Sit = true
hit.Velocity = Vector3.new(math.random(-300,-200),math.random(50,100),math.random(-150,150))
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.