#Value verification isnt working

17 messages · Page 1 of 1 (latest)

manic stratus
#
local player = game.Players.LocalPlayer

for i, v in pairs(script.Parent:GetChildren()) do
    if v:IsA("Frame") and v:FindFirstChild("Place") then
        v:FindFirstChild("Place").MouseButton1Down:Connect(function()
            print("Value of 1 placing: "..script.Placing.Value)
            
            if player[v.Name].Value == "Empty" then

                print("test")
                print("Value of 2 placing: "..script.Placing.Value)
                if script.Placing.Value == nil then
                    local mouse = player:GetMouse()
                    script.Placing.Value = v
                    print("Fere")
                    spawn(function()
                        local t = false
                        while script.Placing.Value ~= nil do
                            wait()
                            if t == false then
                                


#
local tower = game:GetService("ReplicatedStorage").Towers:FindFirstChild(player[v.Name].Value)
                                print(tower)
                                if tower then
                                    tower.Name = player.Name..player[v.Name].Value
                                    tower:Clone().Parent = workspace
                                end
                            end
                            if workspace:FindFirstChild(player.Name..player[v.Name].Value) then
                                local part = mouse.Target
                                if part.Parent == "Placeable" and part.Parent ==  not "DontPlaceables" then
                                workspace:FindFirstChild(player.Name..player[v.Name].Value).HumanoidRootPart.BodyPosition.Position = mouse.Hit.p
                                end
                                end
                        end
                    end)
                    
                elseif script.Placing.Value ~= nil and script.Placing.Value == v then
                    script.Placing.Value = nil
                    
                end
            end
            
            
            
        end)
        
        v.TowerName.Text = player[v.Name].Value
        
        player[v.Name].Changed:Connect(function()
            v.TowerName.Text = player[v.Name].Value
        end)
        
        
    end
end
cosmic nexus
#

its string or what

manic stratus
#

the value are strings

cosmic nexus
#
 if script.Placing.Value == "" then
manic stratus
#

keeps equal

cosmic nexus
#

wait

#

which code uses it?

manic stratus
#

they are sames, i separete it cause its so long

#

that is it

#

the fully code

manic stratus
manic stratus
#

oh wait