I’d like it so when a player presses a certain key, they can disable all other players StarterPlayerScripts to prevent spam in my game
I tried doing the follwowing code (My mentor made a few comments and edited the code)
Code
for i, v in pairs(game:GetService("Players"):GetPlayers()) do
if v ~= plr then
--[[for i, v in pairs(v.Character:GetChildren()) do
if v:IsA("BasePart") then
v.Humanoid.WalkSpeed = 9
end
Baseparts dont have humanoids. Why did you add this?
]]
local VChar = v.Character or v.CharacterAdded:Wait()
VChar:WaitForChild("Humanoid").WalkSpeed = 9
game.StarterPlayer.StarterPlayerScripts.ControlToRun.Disabled = true
v.PlayerScripts.TimeStop.Disabled = true
v.PlayerScripts.TimeSlow.Disabled = true
v.PlayerScripts.TimeFreeze.Disabled = true
end
end
``
But it didnt work out
Ive looked on the devforum for anything about disabling starter player scripts but i couldnt find anything
Not entirely sure what you mean by “prevent spam”. You are on the right track.
Also, notice this why not have those types of scripts within StarterCharacterScripts?
You do
game.StarterPlayer.StarterPlayerScripts
and
v.PlayerScripts
what are you trying to disable? Its unclear because you already have what you would need to solve your problem. That’s why I just need a little more clarification on what your trying to achieve.
When a player pressed Q, E, or R in my game the saturation changes, and as of now its currently spammable. I want it so that it wont spam to prevent people with epilepsy to not have an epileptic episode
Preventing spam could be done some other way instead of disabling scripts. I take it for the client to be able to do these Moves they need a fire a remote you can just add a debounce with the remote preventing any sort of excessive usage.