I want to make a script where the floor becomes slippery but when i run it, it says "friction cannot be assigned to" I am very confused, This is my script.
local RandomNumber = math.random (1,1) if RandomNumber == 1 then game.Workspace.Baseplate.Material = "Ice" game.Workspace.Baseplate.CustomPhysicalProperties.Friction = 0 game.Workspace.Baseplate.CustomPhysicalProperties.FrictionWeight = 100 end
You can't assign or write to the properties directly. Instead, you'd want to construct a new PhysicalProperties object with the properties you desire:
local baseplate = workspace.Baseplate local originalProps = baseplate.CustomPhysicalProperties baseplate.CustomPhysicalProperties = PhysicalProperties.new( originalProps.Density, 0, -- Friction, originalProps.Elasticity, 100, -- Friction weight originalProps.ElasticityWeight )
hey you! have you ever heard of enes? if you are in trouble, better call enes!