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)