Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you take away a players control?

I'm trying to take away a players control so that it isn't able to move I check wiki but I have trouble with tables.Any videos or website,anything that can help me?. I tried to anchor the player Torso but its invalid or something. Any help?

local Code = script.Parent.Parent.Parent.Password.Code
local player = game.Players.LocalPlayer
local wrongs = 0
local Control = game.Players.LocalPlayer.PlayerScripts.ControlScript.Disabled

Control = true
function C()
if Code.Text == "2593316" then 
    wait(.1)
    Control = false
    wait(.1)
    player.PlayerGui.EntryGui.ENTER.TextButton.TextTransparency = 1
    wait(.1)
    Code.TextTransparency = 1
    wait(.1)
    Code.TextStrokeTransparency = 1
    wait(.1)
    player.PlayerGui.EntryGui.Black.Visible = false
    wait(.1)
else
    if wrongs == 0 then
    player.PlayerGui.EntryGui.Wrong1.Visible = true
wait(.5)
    player.PlayerGui.EntryGui.Wrong1.Visible = false
        wrongs = wrongs+1
     wait(.1)
    elseif wrongs == 1 then
    player.PlayerGui.EntryGui.Wrong1.Visible = false
    player.PlayerGui.EntryGui.Wrong2.Visible = true
wait(.5)
    player.PlayerGui.EntryGui.Wrong2.Visible = false
    wrongs = wrongs+1
     wait(.1)
    elseif wrongs == 2 then
    wrongs = wrongs+1
    player.PlayerGui.EntryGui.Wrong1.Visible = false
    player.PlayerGui.EntryGui.Wrong2.Visible = false
    player.PlayerGui.EntryGui.Wrong3.Visible = true
wait(.5)
    player.PlayerGui.EntryGui.Wrong3.Visible = false
wait(1)
    player.PlayerGui.EntryGui.Wrong1.Visible = true
wait(.1)
    player.PlayerGui.EntryGui.Wrong2.Visible = true
wait(.1)
    player.PlayerGui.EntryGui.Wrong3.Visible = true
wait(2)
    player:Kick()
        end
    end
end
script.Parent.MouseButton1Click:connect(C)



This is what the output said.Some of it is my plugins. 15:38:28.581 - Auto-Saving... Loaded gloo library. Type _G.gloo.Help() for help. 15:38:29.353 - ItemButton is not a valid member of Script 15:38:29.354 - Script 'Plugin_321426830.KinqStudioDailyAwardPlugin', Line 49 15:38:29.354 - Stack End Loading Cutscene Editor... 15:38:29.593 - Unable to load plugin icon. Image may have an invalid or unknown format. 15:38:29.597 - Unable to load plugin icon. Image may have an invalid or unknown format. 15:38:29.607 - Unable to load plugin icon. Image may have an invalid or unknown format. 15:38:29.621 - Unable to load plugin icon. Image may have an invalid or unknown format. 73681737 15:38:37.258 - ControlScript is not a valid member of PlayerScripts 15:38:37.258 - Script 'Players.Player.PlayerGui.EntryGui.ENTER.TextButton.LocalScript', Line 8 15:38:37.259 - Stack End

2 comments

0

Why not just Anchor the Character's Torso and other limbs?

0

I tried that and it didn't work ; game.Players.LocalPlayer.Torso.Anchored = true

1 answer

✓ Accepted answer

You've made an incredibly common mistake:

On line 6, you simply overwrote the existing Value in Control, you did not change the ControlScript.Disabled property.

To fix that, use an object reference in the variable instead of trying to make a property reference:

local Control = game.Players.LocalPlayer.PlayerScripts.ControlScript

Control.Disabled = true -- Don't forget to set this back to false when you're done!

=============================

If that doesn't work, you should try setting the Player's Humanoid's WalkSpeed and JumpPower properties to 0, as that will allow physics to affect them, but not their inputs.

2 comments

0

How would I do that? It doesn't work btw It has no error it just doesn't work.

0

I'm not sure what you're asking how to do.

This discussion is preserved as it was. New answers, comments, and votes are closed.