I have no idea if there is anything wrong with this, because I am not getting any errors. It is not working though. Please someone help me.
wait(0.5) local cd = game.Workspace.GeneratorOne:WaitForChild("On"):WaitForChild("ClickDetector") local s = cd.Parent.Parent.server cd.MouseClick:connect(function() print("C") -- Attempt to see if this part was running, wasn't. if s.Value == false then print("b") -- Attempt to see if this part was running, wasn't. game.Workspace.GenUp:FireServer() s.Value = true else end end)
It seems you have not understood the definition of Remote Events
.
Remote Events
are a Roblox Instance
which allows the Server Script
to communicate with a Local Script
. Not Server Script
to Server Script
or Local Script
to Local Script
.
In your scenario, you attempted on communicating Server Script
with another Server Script
. I am stating this because that is what you showed in your GIF. The call is never invoked. Thus, it does not error, nor does any of it print.
So. What is the Solution?
Bindable Events
are also Roblox Instances
with its function similar to of Remote Events
except, it only communicates with the same type i.e Server Script
to Server Script
and Local Script
to Local Script
.
Now I cannot exactly use your code but take a look at my example.
-- [Declaration Section] local Baseplate = workspace.Baseplate; local Click = Baseplate.ClickDetector; local BindableEvent = workspace.Event; local Zafs_Str = "Brrrrrr"; -- [Processing Section] local function On_Click () BindableEvent:Fire(Zafs_Str); end; -- [Connecting Section] Click.MouseClick:Connect(On_Click);
-- [Declaration Section] local BindableEvent = workspace.Event; -- [Processing Section] local function Print_When_Invoked (str) print(str); end; -- [Connecting Section] BindableEvent.Event:Connect(Print_When_Invoked);
Resources to Learn.