So, I’ve worked on an explosion and… the results are pretty strange. For some reason, every time I clicked, the explosion appears. I don’t have my recording software since my computer broke to show proof.
Here’s the script:
script.Parent.Touched:Connect(function()
print("Touched")
local tweenservice = game:GetService("TweenService")
local part = script.Parent.Explosion:Clone()
part.Position = script.Parent.Parent.Explode.Position
part.Parent = workspace
local info = TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 1, false, 0)
local goal = {
Size = Vector3.new(5.4, 5.4, 5.4)
}
local c = tweenservice:Create(part, info, goal)
c:Play()
end)
Basically, every time I clicked on a specific part, the explosion appears. There’s no other script than this so I’d like a clarification. Thank you. Also, I’ve not downloaded plugins recently.
so how did you want the explosion to happen?
im assuming you want it to happen when a player touches it.
If ^ then use this
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
print("Touched")
local tweenservice = game:GetService("TweenService")
local part = script.Parent.Explosion:Clone()
part.Position = script.Parent.Parent.Explode.Position
part.Parent = workspace
local info = TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 1, false, 0)
local goal = {
Size = Vector3.new(5.4, 5.4, 5.4)
}
local c = tweenservice:Create(part, info, goal)
c:Play()
end
end)
No, I want it when the part touches it. Adding on, this is an explosion test and not a game, the parts will move directly to each other so there’s no need to add an if statement.
script.Parent.Touched:connect(function(hit)
if hit:IsA("Part") then
print("Touched")
local tweenservice = game:GetService("TweenService")
local part = script.Parent.Explosion:Clone()
part.Position = script.Parent.Parent.Explode.Position
part.Parent = workspace
local info = TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 1, false, 0)
local goal = {
Size = Vector3.new(5.4, 5.4, 5.4)
}
local c = tweenservice:Create(part, info, goal)
c:Play()
end
end)
tell me if the clicking problem still occurs…
but i am needing of sleep now… been awake with 2 cans of mtndew
Clicking problem still occurs, perhaps it has to do with one of my plugins? I’ve made a plugin that if you click a part spheres appear so I’m guessing that’s the problem but then yet again, I don’t know how to remove the plugin. I’ll try uninstalling.