local eventmodel = script.Parent
local one = eventmodel.part1
local two = eventmodel.part2
local three = eventmodel.part3
local four = eventmodel.part4
local restoreproxy = eventmodel.restore.proximity.ProximityPrompt
restoreproxy.Enabled = false
one.ClickDetector.MouseClick:Connect(function()
for _, part in pairs(one:GetChildren()) do
if part:IsA("BasePart") then
part.Transparency = 1
part.CanCollide = false
end
end
one.ClickDetector.MaxActivationDistance = 0
end)
two.ClickDetector.MouseClick:Connect(function()
for _, part in pairs(two:GetChildren()) do
if part:IsA("BasePart") then
part.Transparency = 1
part.CanCollide = false
end
end
two.ClickDetector.MaxActivationDistance = 0
end)
three.ClickDetector.MouseClick:Connect(function()
for _, part in pairs(three:GetChildren()) do
if part:IsA("BasePart") then
part.Transparency = 1
part.CanCollide = false
end
end
three.ClickDetector.MaxActivationDistance = 0
end)
four.ClickDetector.MouseClick:Connect(function()
for _, part in pairs(four:GetChildren()) do
if part:IsA("BasePart") then
part.Transparency = 1
part.CanCollide = false
end
end
four.ClickDetector.MaxActivationDistance = 0
end)
local module1 = one.module
local module2 = two.module
local module3 = three.module
local module4 = four.module
if module1.Transparency == 1 and module2.Transparency == 1 and module3.Transparency == 1 and module4.Transparency == 1 then
restoreproxy.Enabled = true
end
restoreproxy.Triggered:Connect(function()
eventmodel.RemoteEvent:FireServer()
end)
Serverscript: (the handler basically)
local event = script.Parent
event.OnServerEvent:Connect(function()
-- yea i gave up basically here
end)
when replicating from the client to the server, you can get the client (player) as the first argument in the OnServerEvent event
local event = script.Parent
local badgeservice = game:GetService("BadgeService")
event.OnServerEvent:Connect(function(player)
if not badgeservice:UserHasBadgeAsync(player.UserId, 69696969) then -- second argument is the badge id
badgeservice:AwardBadge(player.UserId, 69696969)
end
end)
if module1.Transparency == 1 and module2.Transparency == 1 and module3.Transparency == 1 and module4.Transparency == 1 then
game.Workspace.event.restore.proximity.ProximityPrompt.Enabled = true
end
module1:GetPropertyChangedSignal("Transparency"):Connect(function()
if module2.Transparency == 1 and module3.Transparency == 1 and module4.Transparency == 1 then
restoreproxy.Enabled = true
end
end)