FE Script value asking for Vector3 when is it a normal value?
I am honestly confused.
When I use a local script from a player's gui, the local script fires a server event that places a thing. However, for some reason. the 'cost' variable is being asked for a vector3 in the logs, when its a number value.
Placing ServerEvent Code:
1 | game:GetService( "ReplicatedStorage" ).LocalEvents.Placing.OnServerEvent:connect( function (tower,pos,cost,rotation) |
2 | game:GetService( "ReplicatedStorage" ).Stats.Cash.Value = game:GetService( "ReplicatedStorage" ).Stats.Cash.Value - cost |
3 | local tt = game:GetService( "ReplicatedStorage" ).Storage.Turrets [ tower ] [ tower ] :Clone() |
5 | tt.Parent = workspace.Game.Turrets |
6 | tt:SetPrimaryPartCFrame(CFrame.new(pos.X,((tt.PrimaryPart.Size.Y/ 2 )+pos.Y)+ 0 ,pos.Z)*CFrame.Angles( 0 ,rotation.y, 0 )) |
7 | tt.Config.Shoot.Disabled = false |
8 | tt.Config.Cost.Value = cost |
Player Place LocalScript (Shortened):
4 | game:GetService( "ReplicatedStorage" ).LocalEvents.Placing:FireServer(tower,mouse.Hit.p,cost,lastrot) |
ServerScriptService.Worker:2: bad argument #1 to '?' (Vector3 expected, got number)
Does anybody know why this is occuring? Thanks!