Error with trying to write a remote function

been trying to figure this out for a couple days but i cant even do the OnServerInvoke with the proper calls?

Server Script


game.ReplicatedStorage.Events.PlaceTower.OnServerInvoke = function(player, u2.Name, v26.Position, u1)

end

Local Script


local v103 = game.ReplicatedStorage.Events.PlaceTower:InvokeServer(u2.Name, v26.Position, u1)

end

image

I don’t think you can use dot notation when defining variables in the callback function for OnServerInvoke; define them without the . for example player, u2, v26, u1 and then below just do u2 = u2.Name; v26 = v26.Position

1 Like

u2 is a function argument, so you can’t just do u2.name, instead you would have to do:

game.ReplicatedStorage.Events.PlaceTower.OnServerInvoke = function(player, u2, v26, u1)
    local name = u2.Name
    local position = v26.Position
end

P.S. Name your variables better.

1 Like

thanks guys i will do that, hopefully it will get me to my next step, i would rename them but i been studying the local script my buddy got for like 72 hours i do not want to confuse myself lol