local Replicated = game:GetService("ReplicatedStorage") local Event = Replicated.RemoteEvents.JobEvent script.Parent.MouseButton1Click:Connect(function() Event:FireServer() end)
local Replicated = game:GetService("ReplicatedStorage") local Event = Replicated.RemoteEvents.JobEvent local function Job(Player) Player.leaderstats.Money.Value Player.leaderstats.Money.Value + 100 workspace.Good:Destroy() workspace.Wrong1:Destroy() workspace.Wrong2:Destroy() workspace.Wrong3:Destroy() if workspace:FindFirstChild("NPC") then workspace.NPC:Destroy() end end Event.OnServerEvent:Connect(Job)
So I noticed a few things about your script, but to know exactly what to fix I'm going to need to know what type of script the scripts are (local, server) and if this script actually does anything. But try doing a few of these fixes anyways, maybe that'll fix your problem?
Firstly, I know you've said that the events do exist, but neither of the scripts create the event? Create the event using a script, not just insert it into the replicated storage yourself. Replace the remoteevent stuff in the click script with this:
local Replicated = game:GetService("ReplicatedStorage") local Event = rs:WaitForChild("JobEvent")
And the remote event stuff in the other script with this:
local Replicated = game:GetService("ReplicatedStorage") local Event = Instance.new("RemoteEvent") Event.Parent = Replicated Event.Name = ("JobEvent")
Secondly, what is line 4 of your second script exactly supposed to do? It doesn't set a variable or set a value, it's just there, and I thought maybe there's something you forgot to do with that line? (This line)
Player.leaderstats.Money.Value