I'm making a GUI button that when pressed converts a currency called "etherium" into cash. Problem is, the scripts work perfectly fine in a local test but once I go into a filtering enabled environment they fail to work. Etherium is stored in a folder inside of the player, and cash is in the server storage.
--This is the local script inside of a button local ReplicatedStorage = game:GetService("ReplicatedStorage") local EthTransfer = ReplicatedStorage:WaitForChild("EtheriumTransferService") function onClick() local p = game.Players.LocalPlayer EthTransfer:FireServer(p) script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Cash:Play() end script.Parent.MouseButton1Down:connect(onClick)
--This is the script inside workspace local ReplicatedStorage = game:GetService("ReplicatedStorage") local EthTransfer = Instance.new("RemoteEvent", ReplicatedStorage) EthTransfer.Name = "EtheriumTransferService" local function onEthFired(localPlayer) print("recieved event") local eth = localPlayer.EtheriumCount.Etherium local Stats = game.ServerStorage.PlayerMoney:FindFirstChild(localPlayer.Name) local addition = eth.Value * 10 Stats.Value = Stats.Value + addition eth.Value = 0 print("event completed") end EthTransfer.OnServerEvent:Connect(onEthFired)
The answer is that you need put these lines
local EthTransfer = Instance.new("RemoteEvent", ReplicatedStorage) EthTransfer.Name = "EtheriumTransferService"
into the server script. When you create the remote event on the localscript, it's local, so the server can't find it, and yields forever.