It's been a while since I've used Roblox studio, and there have been some changes with the way scripts run. Anyways, the problem is that the cannonball that I'm firing Isn't exploding. When I press the f button, the cannonball fires, but it doesn't explode when it hits something. The code below is the script that is in the cannonball.
script.Parent.Touched:connect(function(part)
local explosion = Instance.new("Explosion", script.Parent)
explosion.Position = script.Parent.Position
wait(.1)
script.Parent:Destroy()
end)
Everything looks completely fine in this script, and even when I try to print sentences, it does absolutely nothing. Nothing that is put in the script does anything. The cannonball is stored in Replicated Storage, and the script is not disabled. When I press f to fire the cannon, the cannonball is cloned from Replicated Storage, and a body velocity is inserted into it for it to move. It's extremely odd and I have absolutely no idea why it doesn't work.

7 comments
Are you cloning the cannonball through a local script? If so, that would probably be why the script inside the cannonball isn’t working. You can use remote events to fix this : https://developer.roblox.com/articles/Remote-Functions-and-Events
And assuming you’ve haven’t used Roblox Studio for a very long time, the cause of this is FilteringEnabled. It’s been forced on for all games now and now games work like this : https://developer.roblox.com/articles/Roblox-Client-Server-Model
K thanks, I'll look at those
I read up on it, but I am still unsure as to how I'm supposed to use :FireServer() in my local script when I clone the cannonball
I would put cannonball into ServerStorage. This way you cannot clone it from client and will force you to do it right first time. Your local script then should ask server to clone the cannonball (passing position), and the server should handle the rest.
Okay, I figured it out, but there is like a half second delay where the cannonball appears and then begins to zoom in the target direction. It kind of pisses me off that this was so difficult, especially since the previous method worked perfectly without delay.
^ If you don’t like the delay, there’s a tutorial that should help you get rid of it. It’s also really strange on how this tutorial is almost EXACTLY like your problem : https://developer.roblox.com/articles/Fighting-Against-Lag