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:
game:GetService("ReplicatedStorage").LocalEvents.Placing.OnServerEvent:connect(function(tower,pos,cost,rotation) game:GetService("ReplicatedStorage").Stats.Cash.Value = game:GetService("ReplicatedStorage").Stats.Cash.Value - cost local tt = game:GetService("ReplicatedStorage").Storage.Turrets[tower][tower]:Clone() tt = tt:Clone() tt.Parent = workspace.Game.Turrets tt:SetPrimaryPartCFrame(CFrame.new(pos.X,((tt.PrimaryPart.Size.Y/2)+pos.Y)+0,pos.Z)*CFrame.Angles(0,rotation.y,0)) tt.Config.Shoot.Disabled = false tt.Config.Cost.Value = cost end)
Player Place LocalScript (Shortened):
tower = "Gunner" cost = 300 lastrot = math.rad(90) 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!