Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

The Criminals on line 12 is under lined with blue, what have I done wrong?

I'm not sure what to do but all I know that the script isn't functioning properly because the word Criminals isn't working on line 12 with the rest of the script, do I need to put something before or after? Here is the GUI lay out>
Team Change(THE GUI), CameraHandler (Current script) TeamChanger (ANOTHER SCRIPT), Frame, and with Criminals and Police under it.

local Player=game.Players.LocalPlayer
local Char=Player.Character or Player.CharacterAdded:Wait()
local camera=workspace.CurrentCamera

game.StarterGui["Team Change"].frame.Criminals = script.Child.Criminals


wait(0.1)
camera.CameraType=Enum.CameraType.Scriptable
camera.CFrame=workspace.Cam.CFrame

Criminals.MouseButton1Click:Connect(function()
	camera.CameraType = 'Custom'
end)

1 comment

0

Have you defined what criminals is?

2 answers

Have you defined what criminals is?

2 comments

0

you don't need to define the classname of a textbutton lol

0

wdym and where?

you most likely made the error with uncapitalizing a capitalized thing, it is CASE SENSITIVE.

this should be your fix:

local player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local camera = workspace.CurrentCamera

game.StarterGui["Team Change"].Frame.Criminals = script.Child.Criminals
wait(0.1)
camera.CameraType=Enum.CameraType.Scriptable
camera.CFrame=workspace.Cam.CFrame
 
Criminals.MouseButton1Click:Connect(function()
    camera.CameraType = 'Custom'
end)

i should also say this needs to be in a local script to index localplayer. gg nor e you should also be using game.Workspace to index workspace lol

This discussion is preserved as it was. New answers, comments, and votes are closed.