Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there any new way to get "PlayerScripts"?

Asked by
Wutras 294 Moderation Voter
8 years ago

I've been using "PlayerScripts" for a few things in some recent scripts and they yet worked without a problem. I'm having an example script over here to show it work works:

script.Parent.Touched:connect(function(part)
    script.Disabled = true
    if game.Players:GetPlayerFromCharacter(part.Parent) then
        if script.Parent.Locking.Value == true then
            local player = game.Players:GetPlayerFromCharacter(part.Parent)
            local control = player.PlayerScripts.ControlScript
            control.Parent = nil
            script.Parent.Locking.Changed:connect(function()
                if script.Parent.Locking.Value == false then
                    control.Parent = player.PlayerScripts
                end
            end)
        end
    end
    wait()
    script.Disabled = false
end)

But now "PlayerScripts" seems to only exist in Studio, but not in real servers. So now I'm wondering how to get "PlayerScripts" to fix scripts. Any method, function or whatever would be appreciated really much.

Thanks in advance,

MrHaIIoween

0
On line 2, it looks like it disables itself. Were you trying to add a debounce, or am I reading this incorrectly? Pyrondon 2089 — 8y
0
@Pyrondon, nope you're reading this right... M39a9am3R 3210 — 8y
0
I've added a debounce, but as this script is old, the debounce is not really good. Wutras 294 — 8y

Answer this question