#SetCoreGuiEnabled is not a valid member of PlayerGui "Players.Player1.PlayerGui"
17 messages · Page 1 of 1 (latest)
It should be:
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
Sure you can, not to change GUIs for players, but you can use StarerGui to turn on and off Core GUIs
The script? or what
If you are talking about the script location, then it can be everywher a local script works
Show the code
Instead of having a script that is moved around and enabled/disabled, create a system
function turnBackpack(bool)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, bool)
end
turnBackpack(false) --as default maybe
--using remote event or any kind of event turn on backpack
Maybe not
Explain what you are trying to do
And you want to keep moving that script to another tool or what?
So you are doing a handcuff system, right? Why dont you add a boolean value for each player to be true when handcuffed and false when not
Then you are just gonna use changed on that boolean to chance backpack on or off
Having a script to be moved (/cloned) and to be enabled/disabled is not the best idea
Could you send this script?
one local, one server and one remote event for targetchar
Local script:
local remote = script.Parent:WaitForChild("RemoteEvent")
local tool = script.Parent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local boolValue = PLAYER_BOOL_VALUE
tool.Activated:Connect(function()
local target = mouse.Target
if target == nil then return end
local player = game:GetService("Players"):FindFirstChild(target.Parent.Name)
if not player then return end
local targetChar = player.Character
local distance = (tool.Parent.HumanoidRootPart.Position - targetChar.HumanoidRootPart.Position).Magnitude
if distance > 8 then return print("Sei troppo lontano!") end
remote:FireServer(targetChar)
end)
function turnBackpack()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, boolValue.Value)
end
boolValue.Changed:Connect(turnBackpack)
Server Side:
Here you would need to run OnServerEvent and do all the checking, handcuff the player, change target player boolvalue to true if cuffed and false if not
Hm... I dont think so