Hello everybody!
So, lately I’ve been working non-stop on this tower defense game I’m developing.
Everything was going fine until, today, I found out that some of my scripts weren’t working at all.
The issue:
While working with a Part and a ClickDetector inside, I noticed that the LocalScript (which should have given a message to the server via remote events upon click) wasn’t working at all. I tried putting some prints and breakpoints to check everything, but nothing happened. After some time, I found out that not only was the script not running, but none of the other LocalScripts or ServerScripts were either!
The code I used:
print("Script running!")
local clickDetector = script.Parent:WaitForChild("ClickDetector")
local remote = game:GetService("ReplicatedStorage"):WaitForChild("TowerUI")
clickDetector.MouseClick:Connect(function()
print("Click!")
remote:FireServer(script.Parent.Parent,script.Parent.Parent.Stats.Tower.Value)
end)
The output:
Nothing.
The solutions I tried:
First of all, as stated before, I tried creating more Local and Server scripts, leaving them with just print("Hello world!"), but nothing. The output is blank.
Other notes:
Here’s a screenshot of the hierarchy of the script:
You might notice that it’s placed in ReplicatedStorage, but the model gets cloned and put inside Workspace through another script. Also, the script is never disabled / cloned / destroyed anywhere.
