Roblox remote event passing in int and getting nil?
In the script server side I have:
1 | local hoverEnterAmmo = game.ReplicatedStorage.HoverEnterAmmo |
2 | num = script.Parent.AmmoNumStored |
4 | num.Value = math.random( 1 , 50 ) |
6 | script.Parent.ClickDetector.MouseHoverEnter:connect( function (Player) |
8 | hoverEnterAmmo:FireClient(Player, num.Value) |
In the local script I have:
1 | local hoverLeaveAmmo = game.ReplicatedStorage:WaitForChild( "HoverLeaveAmmo" ) |
2 | hoverEnterAmmo.OnClientEvent:connect( function (player, num) |
3 | textForHover.Position = UDim 2. new( 0 , Mouse.X, 0 , Mouse.Y + 15 ) |
4 | textForHover.Visible = true |
Not sure I'm doing it correctly at all, when I print(num) in the local script I get nil what am I doing wrong? Thanks for your help it's much appreciated!