Remote function won't even print value nor return a value

So as the title says the remote function isn’t doing anything, this is a simple piece of code and I don’t know why it’s not working ??

ServerScript:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local UIFunctions = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("TowerUIFunction")

UIFunctions.OnServerInvoke = function(player, args)
	print("RECIEVED")
	return true
end

Local Script:

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")

local player = Players.LocalPlayer

local towerGui = player.PlayerGui:WaitForChild("Test"):WaitForChild("Tower")

local UIRemote = ReplicatedStorage.Remotes.TowerUIFunction

towerGui.UpgradeButton.Activated:Connect(function()
	local UpgradeValid = UIRemote:InvokeServer("UpgradeTower")
	print(UpgradeValid)
end)

towerGui.SellButton.Activated:Connect(function()
	local SellValid = UIRemote:InvokeServer("SellTower")
	print(SellValid)
end)

towerGui.TargettingButton.Activated:Connect(function()
	local targettingChangeValid = UIRemote:InvokeServer("UnitPriority", towerGui.TargettingButton.ButtonText.Text)
	print(targettingChangeValid)
end)
1 Like

Issue fixed, it was a problem with my roblox studio so i restarted it and the code worked

1 Like

Happy for you!
Please mark your topic as solved for future people to see that your issue has been solved. :+1:t2: