task.wait(1)
bindable = workspace.Intersection.Detector.power
IsPart = false
function ToggleGUI(hit)
local Player = game:GetService("Players")
local frame = Player.LocalPlayer.PlayerGui.SurfaceGui.Frame
if frame.Visible == false then
frame.Visible = true
end
end
function Change(power)
if hit == "RedPart" and IsPart == true then
print(power)
print(hit)
end
end
function Detect(hit)
local str = string.sub(hit.Name, -4, -1)
if str == "Part" then
ToggleGUI(hit)
IsPart = true
else
task.wait(0.01)
end
end
workspace.Intersection.Detector.Touched:Connect(Detect)
bindable.Event:Connect(Change)
so i need thats Detect function somehow transfer hit to change, i guess i need two args(or not) but im dont know how to correct transfer it
** You are now Level 6! **