You can write your topic however you want, but you need to answer these questions:
What I want to achieve: I’m trying to make a tsunami, that will unanchor the part on impact and wait 10 seconds for it to be destroyed.
What is the issue: Once it hits the brick I want it to unanchor it, but it doesn’t even react to it being touched! Here is the script I’m using:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
if hit:IsA("Part") and not hit.Name == "Water" then
print("detected") --- It never prints this, but it does kill players.
hit.Anchored = false
wait(10)
hit:Destroy()
end
end)
Solutions I have tried: I’ve tried searching it on google and on the Developer Forum.
It does move, I just haven’t included that part of the script.
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
elseif hit:IsA("Part") and not hit.Name == "Water" then
print("detected") --- It never prints this, but it does kill players.
hit.Anchored = false
wait(10)
hit:Destroy()
end
end)
or maybe its a mesh part that you didn’t recognise
So i think you should put a script in serverstorage like this: script.Parent.Anchored = false wait(10) script.Parent:Destroy()
and then on main script make the script clone on parts: destroypart = game.ServerStorage.yourscriptname:Clone() destroypart.Parent = hit
So it’s like a virus that you insert in the part that will destroy them, i already did these type of things try this.
local TweenService = game:GetService("TweenService")
local part = script.Parent
local goal = {}
goal.Position = Vector3.new(-32.585, 244.228, -496.213)
local tweenInfo = TweenInfo.new(100)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
It did the same issue to me and by removing not and placing that symbol i fixed that. elseif hit:IsA("BasePart") and hit.Name ~= "Water" then it can seem stupid but try.
I would use BodyMovers for this. With them, you can make the tsunami unanchored and can-collide false. I believe this is the method used in Natural Disaster Survival.
try by add a .Parent to the Hit, your script should look like this:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
if hit:IsA("Part") and not hit.Name == "Water" then
print("detected")
hit.Parent.Anchored = false --See here
wait(10)
hit:Destroy()
end
end)
Try elseif hit:IsA("BasePart") and hit.Name ~= "Water" then it isn’t a bug of colliding because on player works the IF is the problem use that script cloning too.
Why you dont try by removing the and not hit.Name == “Water“, possibly its this the issue. If it print while you have removed this code snipped then you know that you muss edit this part.