I am trying to make a script where when someone enters the game it changes rotation. But apparently there is an error on line 2. This is a regular script in a leaf (part).
game.Players.PlayerAdded:connect(function() game.Workspace.Leaf.Rotation = (math.random(), math.random(), math.random()) -- The output says Error in script: ')' expected near ',' but I have no idea what is wrong with it. end)
I'm pretty sure the issue comes in with the use of Rotation
. You would be much better off using CFrame.
I would instead do this --
local leaf = game.Workspace.Leaf leaf.CFrame = CFrame.new(leaf.CFrame.x, leaf.CFrame.y, leaf.CFrame.z) * CFrame.Angles(math.random(), math.random(), math.random()) -- you have to include the .new portion, so that will keep it in the same position while changing its rotation.
I've not tested that, but I'm pretty sure it would work. If it doesn't, let me know.