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

Why won't the part appear?

enabled = true
player = script.Parent.Parent.Parent
bin = script.Parent
function onKeyDown(key)
	key:lower()
	if key == "z" then
		if bin.Prevent.Value == 1
		then
		enabled = false 
		end
		
	bin.Prevent.Value = 1
		
		

	function Talk(msg)
game:GetService("Chat"):Chat(me.Character.Head, msg, Enum.ChatColor.Red)
end

	local player = game.Players.LocalPlayer
	if player == nil then return end
      enabled = false 
	end

		
	
		Talk("Ice-Make: Shield")
		Run = game:GetService("RunService")
		x = Instance.new("Part")
		x.Parent = game.Workspace
		x.BrickColor = BrickColor.new("Toothpaste")
		x.Size = Vector3.new(4.5, 4.5, 4.5)
		x.TopSurface = "Smooth"
		x.BottomSurface = "Smooth"
		x.Shape = "Block"
		x.Name = me.Name
		x.CanCollide = false
		x.Anchored = true
		x.Transparency = 0.7
		x.Parent = workspace
		x.CFrame = player.Character.Torso.CFrame * CFrame.new(0, 2, -1)
		x.CFrame = x.CFrame * CFrame.Angles(0, 0, 1.5)
		
		
end	
function onSelected(mouse) 
mouse.KeyDown:connect(onKeyDown) 
end 
 
script.Parent.Selected:connect(onSelected)

This is a new style of scripting I am trying. I am using numbervalues to prevent other keys from working while one is running. My only problem is that the part that needs to appear won't appear.

1 comment

0

Oh, Fairy Tail, noice...

1 answer

you have to much ends try removing end at line 23

btw ur script is rly messy idk why u have a talk function there and if this is a local script then you should remove lines 20,21,22,23

2 comments

0

All of the ends correctly end each function. line 23 ends the if on line 21. Please re-read carefully.

0

...

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