So im currently scripting a menu gui. I have a camera shake script on workspace that is "disabled = false" So it plays. The only thing thoe is that i want it to be disabled when you hit play so the camera doesn't shake the whole time, just in the menu. Right now i have a mousebutton1click function, that has some code in it. Does somebody know how to disable a script in workspace with a localscript in a textbutton in startergui??
at the bottom of the script is the lines where i have tried disabling the script...
Here is the script so far:
-- Locals -- local Camera = game.Workspace.CurrentCamera local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Humanoid = Character:WaitForChild("Humanoid") -- Main -- script.Parent.MouseButton1Click:Connect(function() game.Workspace.Glitch.Playing = true wait(4) game.Workspace.MenuSound.Playing = false game.Workspace.CitySound.Playing = true Camera.CameraType = Enum.CameraType.Custom Camera.CameraSubject = Humanoid script.Parent.Visible = false end) script.Parent.MouseButton1Click:Connect(function() wait(4) game.Workspace.ScreenShake.Disabled = true end)
Try this:
-- Locals -- local Camera = game.Workspace.CurrentCamera local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Humanoid = Character:WaitForChild("Humanoid") -- Main -- script.Parent.MouseButton1Click:Connect(function() game.Workspace.Glitch.Playing = true wait(4) game.Workspace.MenuSound.Playing = false game.Workspace.CitySound.Playing = true Camera.CameraType = Enum.CameraType.Custom Camera.CameraSubject = Humanoid script.Parent.Visible = false wait(4) game.Workspace.ScreenShake.Disabled = true end)
I think that will work. If not then I would probably request some more examples of what is going on.
Couldn't you just make a module script saying
script.Disabled = true
I believe you can't use a local script so you should use a Remote Event so
In the local script:
script.Parent.MouseButton1Click:Connect(function() game.Workspace.RemoteEvent:FireServer() end)
then add a script in the Remote Event and put this in the script:
script.Parent.OnServerEvent:Connect(function() game.Workspace.Script.Disabled = true end)