Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't the part appear?

Asked by 9 years ago
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.

0
Oh, Fairy Tail, noice... GreekGodOfMLG 244 — 9y

1 answer

Log in to vote
-1
Answered by 9 years ago

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

0
All of the ends correctly end each function. line 23 ends the if on line 21. Please re-read carefully. minikitkat 687 — 9y
0
... Relampago1204 73 — 9y
Ad

Answer this question