I wan’t to fix my buypad module for my tycoon!
The issue is the NextPad..CanTouch = true won’t work the Nextpad stays with the property OFF
Please help me, even a AI can’t find whats going on! I TRIED CREATAING SCRIPTS DIDNT WORK AND I EDITED THE MODULE, STILL DIDNT WORK.
Module Code:
local module = {}
local TweenService = game:GetService("TweenService")
function module.PadUse(Object, Pad, Nextpad, ObjectName, Price, Caller)
local Tycoon = script.Parent.Parent
if Caller.Name == Tycoon.ClaimGate.ClaimPart.TycoonOwner.Value then
if Caller.leaderstats.Cash.Value >= Price then
Caller.leaderstats.Cash.Value -= Price
Pad.Head.CanTouch = false
Pad.Head.CanCollide = false
local Transparency = TweenService:Create(Pad.Head, TweenInfo.new(0.5),{Transparency = 1})
Transparency:Play()
Pad.Head.Purchased:Play()
Transparency.Completed:Connect(function()
Object.Parent = Tycoon
local ObjectChildren = Object:GetChildren()
for NumberOfObjects, OB in pairs(ObjectChildren) do
if OB:FindFirstChildWhichIsA("Script") then
OB:FindFirstChildWhichIsA("Script").Enabled = true
end
if OB:IsA("BasePart") then
OB.CanCollide = true
elseif OB:IsA("Model") then
for _, Sub in pairs(OB:GetDescendants()) do
if Sub:FindFirstChildWhichIsA("Script") then
Sub:FindFirstChildWhichIsA("Script").Enabled = true
end
if Sub:IsA("BasePart") then
Sub.CanCollide = true
end
end
end
end
if Nextpad == nil then
return
else
Nextpad.Parent = Tycoon
Nextpad.Head.CanTouch = true -- Problematic Part!
Pad:Destroy()
end
end)
else
Pad.Head.PurchaseError:Play()
end
else
return
end
end
return module