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)

1 comment
Borderlands? Also "i before e, except after c" looool. Anyways, the problem is that you're are creating a new RemoteEvent with your localscript. What?! The point of FE is that no changes made by localscripts will be replicated to the server. Just have "EtheriumTransferService" made by the server script are already created by default.