Player.GameplayPaused write error

Hello! I know this has been posted in the past, but it seems that every solution I have attempted to apply has failed. I could use some help on this, as I’ve been working at it for a while now.

The error I keep getting while trying to fix this is:
21:18:15.724 Unable to assign property GameplayPaused. Script write access is restricted - Client - LocalScript:14

The LocalScript contains this:


local Player = game.Players.LocalPlayer
local GUI = script.Parent
local ClassData = game.ReplicatedStorage.Mods:GetChildren()

function CreateButton(object)
	local NewButton = Instance.new('TextButton')
	NewButton.TextScaled = true
	Instance.new('UICorner', GUI).CornerRadius = UDim.new(0, 8)
	NewButton.Text = object['.name'].Value
end

Player.GameplayPaused = true

for i, v in ipairs(ClassData) do
	CreateButton(v)
end

Player.GameplayPaused = false

If you can take the time out of your day to help me with this, It would really mean a lot to me, reader. Thank you.

1 Like

Is streaming enabled turned on?

Yeah, it’s turned on. It’s a solution that went down the drain once again :/

also, here is a screenshot of workspace properties: image

The error you’re receiving explains the problem. You cannot write to GameplayPaused as it’s read-only. (however, it doesn’t seem to have a [readonly] tag, so it’s technically edit-able through the property window…)

You should only attempt to read Player.GameplayPaused. You cannot force client physics pausing with StreamingEnabled, it’s automatic. If you just want to stop simulating physics on the player, you can just anchor the player character’s root part.

2 Likes

Ahhhh, I didn’t know it was read only! Thanks!

EDIT: Although that is SUPER STRANGE how it allows you to change it via properties window and not with a script…