- What do you want to achieve? Keep it simple and clear!
I want to unenable a gui in the starterplayerscripts when a player’s character is added.
- What is the issue? Include screenshots / videos if possible!
When I access the playergui, I can’t enable the gui.
Local script in StarterPlayerScripts:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Events = ReplicatedStorage.Events
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character.Humanoid
local playerGui = player.PlayerGui
player.CharacterAdded:Connect(function()
playerGui.StartGui.Enabled = true
camera.CameraType = "Scriptable"
camera.CFrame = workspace.StartCamera.CFrame
Events.Initiate:FireServer("Start")
end)
Local script in button in start screen GUI:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Events = ReplicatedStorage.Events
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character.Humanoid
local camera = workspace.CurrentCamera
script.Parent.MouseButton1Up:Connect(function()
script.Parent.Parent.Parent.Enabled = false
camera.CameraType = "Scriptable"
camera.CFrame = workspace:WaitForChild("Arcade"):WaitForChild("ArcadeCamera").CFrame
end)
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Using a bindable but I wanted to find out about this.
On the line with a weird space is the issue. That’s where enabling doesn’t work.