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

Why is this TextButton LocalScript doesn't run?

Okay so , the script is really simple but for "some reason" it doesn't work whenever i click the TextButton..

local graphic = game.Lighting.Graphics["Only Baseplate"]:clone() --This is a Model
local camera = game.Workspace.CurrentCamera
local checkgfx = script.Parent.Parent.Parent.Low.Value --BoolValue
local gfxmedium = script.Parent.Parent.Parent.Medium.Value --BoolValue
local gfxhigh = script.Parent.Parent.Parent.High.Value --BoolValue
local medium = game.Workspace.CurrentCamera:WaitForChild("Less Details",86400) --This is a Model
local high = game.Workspace.CurrentCamera:WaitForChild("More Details",86400) --This is a Model

function run()
	print("Graphics Changed , Hopefully")
	if checkgfx == false then
		print("Graphics Changed , Hopefully")
graphic.Parent = camera
checkgfx = true
gfxhigh = false
high:Destroy()
gfxmedium = false
medium:Destroy()	
script.Parent.Parent.Parent.H.X.Text = " "
script.Parent.Parent.Parent.M.X.Text = " "
script.Parent.Text = "X"
	elseif checkgfx == true then
    print("You are using this , still")
	end
end


script.Parent.MouseButton1Down:connect(run) --Down and Click doesn't work , i don't know why


i put 2 print()s cuz i wanted to see if it works but it didin't show the print aswell :s Please someone help. i'll credit the person who helped me on my game.

6 comments

0

(Line 28) :connect() is deprecated. Use :Connect().

0

same thing , nothing happend.

0

Line 1, it’s Clone not clone. Also don’t put things in Lighting.Since it is a local script, put it in replicatedstorage and get it from there.

0

The clone doesn't matter , all im trying to figure out is the MOUSEBUTTON1DOWN , when i click it it doesnt print out anything to the console.

0

It does matter. Deprecated code doesn’t work and causes problems .

0

i dont know

1 answer

Remove the .Value in lines 3-5. In lines 11, 14-15, and 22, add the .Value.

1 comment

0

done it , still it doesn't do nothing.

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