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
#Value verification isnt working
17 messages · Page 1 of 1 (latest)
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
its string or what
the value are strings
ty instead of nil do ""
if script.Placing.Value == "" then
in output:
Value of 1 placing: - Client - Monitor:6
Tower1 - Client - Monitor:7
oh wait