game.Players.PlayerAdded:Connect(function(plr) while true do wait(1) local character = plr.Character character.HumanoidRootPart.Position = CFrame.new(math.random(118.701, 2.9, 61.094), math.random(60.81, 2.9, 94.995)) end end)
Math.random() requires two values: min, and max. It returns an integer from min to max, unless Math.random() is not given any arguments. When not given an argument, it returns a value between 0 and 1. This means that it can return something bizare like 0.512333333333.
However, if you want to get an irrational number from math.random(), you can multiply the base function by a constant (like math.random()*100), or divide math.random() with arguments by a constant (like math.random(1, 5000)/100).
If you want to give a random position, you should use math.random three times for the CFrame, like this:
character.HumanoidRootPart.CFrame = CFrame.new(math.random(0, 118), 2.9, math.random(60, 94))
or something along those lines depending on what you wish. Enjoy!
So the first error that I see, you're using CFrame, and that you should use Vector3 like this:
character.HumanoidRootPart.Position = Vector3.new()
Also, Vector 3 should have 3 parameters, for example:
character.HumanoidRootPart.Position = Vector3.new(0, 0, 0) -- 0,0,0 are parameters
But you're trying to make it go random right? So thats when math.random come in! Make sure your math.random has 2 parameters and not 3. Something like:
character.HumanoidRootPart.Position = Vector3.new(math.random(1, 60), math.random(1, 60), math.random(1, 60))
You can edit this anyway possible. And thats all! Hope this works and helps you out! :D