Hello, today I am trying to make a dollar where when the player clicks the dollar adds to the player's wallet everything is fine but I can't use a remote function with server scripts
to go more into the basis of the situation I have a dollar and it's linked to a click detector when the player clicks it's supposed to trigger the remote function but the issue is that remote functions are client-server relationship and scripts are server and you cant have local scripts in workspace to trigger the remote function
so my question is how can I get my script to trigger the remote function then return a value
my code for the dollar in workspace, IT ISA A SCRIPT NOT LOCAL SCRIPT:
local dollar = script.Parent local replicatedStorage = game:GetService("ReplicatedStorage") local clickdetector = dollar.ClickDetector clickdetector.MouseClick:Connect(function(player) local money = replicatedStorage.moneyGrabRemoteEvent:InvokeServer(player, 100000) dollar:Destroy() end)
EDIT: figured it out i used a local script in starter playerscripts to detect the click detector in workspace then i used the event ty