Hello.
I’ve ran into a problem with my Pad System. It detects both players and true’s the “StartGame” Attribute. But truing the value. Nothing happens. In the script its supposed to teleport them onto the platform but it isn’t doing that and I’m confused on why its behaving like that.
Photos:
Code:
-- Services --
local Players = game:GetService('Players')
----
-- Main / For Statement --
for _,Arena in ipairs(workspace.Map.Platforms:GetDescendants()) do
-- Check x2 --
if string.sub(Arena.Name,1,4) == 'Game' and Arena:FindFirstChild('InGame') then
-- Check --
if Arena:GetAttributeChangedSignal('StartGame') then
if Arena:GetAttribute('StartGame',true) then
local Char1 = workspace:FindFirstChild(Arena:GetAttribute('Team1'))
local Char2 = workspace:FindFirstChild(Arena:GetAttribute('Team2'))
-- Teleport --
Char1.HumanoidRootPart.CFrame = CFrame.new(Arena.InGame.Team1.Position.X,Char1.HumanoidRootPart.Position.Y,Arena.InGame.Team1.Position.Z)
Char2.HumanoidRootPart.CFrame = CFrame.new(Arena.InGame.Team2.Position.X,Char2.HumanoidRootPart.Position.Y,Arena.InGame.Team2.Position.Z)
end
end
-- On Change --
Arena:GetAttributeChangedSignal('Team1'):Connect(function()
-- Check x3 --
if Arena:GetAttribute('Team1') ~= '' then
if Arena:GetAttribute('Team2') ~= '' then
Arena:SetAttribute('StartGame',true)
end
end
end)
-- On Change --
Arena:GetAttributeChangedSignal('Team2'):Connect(function()
-- Check x3 --
if Arena:GetAttribute('Team2') ~= '' then
if Arena:GetAttribute('Team1') ~= '' then
Arena:SetAttribute('StartGame',true)
end
end
end)
end
end
----