So i have a screen gui that says "Wheat: 0" and then whenever a remote event is fired it's supposed to increase it by 1 everytime. The issue is I can't get the remote event to fire, and I don't know if i used it in the right context
The wheat is in workspace.wheat
The remote event is in Replicated Storage
The gui is in StarterGui
this code is from the wheat object:
`local wheat = script.Parent
local position = wheat.Position
local rotation = wheat.Orientation
local rep = game:GetService("ReplicatedStorage")
local fireEvent = rep.CollectedWheat
wheat.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
fireEvent:FireServer()
end
end)`
disclaimer: I removed a lot of code for better context because everything else is working perfectly aside from the FireServer()